zephyr: selectable serial device for recovery
This commit adds a choice for the device to use for serial recovery.
Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
fixup
diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c
index ca30bb5..234ad4c 100644
--- a/boot/zephyr/main.c
+++ b/boot/zephyr/main.c
@@ -20,6 +20,7 @@
#include <misc/__assert.h>
#include <flash.h>
#include <drivers/system_timer.h>
+#include <usb/usb_device.h>
#include <soc.h>
#include "target.h"
@@ -66,6 +67,10 @@
rsp->br_hdr->ih_hdr_size);
irq_lock();
sys_clock_disable();
+#ifdef CONFIG_BOOT_SERIAL_CDC_ACM
+ /* Disable the USB to prevent it from firing interrupts */
+ usb_disable();
+#endif
__set_MSP(vt->msp);
((void (*)(void))vt->reset)();
}