zephyr: fix build with zephyr
zephyr macro min() was hanged to MIN()
Kconfig key CDC_ACM_PORT_NAME was changed to CDC_ACM_PORT_NAME_0
zephyr sha of the fixing time is 406dc2cb0e2868392f444677ace416440695829f.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
diff --git a/boot/boot_serial/src/boot_serial.c b/boot/boot_serial/src/boot_serial.c
index bf1474e..1ea009b 100644
--- a/boot/boot_serial/src/boot_serial.c
+++ b/boot/boot_serial/src/boot_serial.c
@@ -588,7 +588,11 @@
if (len != *out_off - sizeof(uint16_t)) {
return 0;
}
- len = min(len, *out_off - sizeof(uint16_t));
+
+ if (len > *out_off - sizeof(uint16_t)) {
+ len = *out_off - sizeof(uint16_t);
+ }
+
out += sizeof(uint16_t);
#ifdef __ZEPHYR__
crc = crc16(out, len, CRC_CITT_POLYMINAL, CRC16_INITIAL_CRC, true);
diff --git a/boot/zephyr/serial_adapter.c b/boot/zephyr/serial_adapter.c
index 14adb45..fad6d19 100644
--- a/boot/zephyr/serial_adapter.c
+++ b/boot/zephyr/serial_adapter.c
@@ -193,7 +193,7 @@
#ifdef CONFIG_BOOT_SERIAL_UART
uart_dev = device_get_binding(CONFIG_UART_CONSOLE_ON_DEV_NAME);
#elif CONFIG_BOOT_SERIAL_CDC_ACM
- uart_dev = device_get_binding(CONFIG_CDC_ACM_PORT_NAME);
+ uart_dev = device_get_binding(CONFIG_CDC_ACM_PORT_NAME_0);
#endif
u8_t c;