File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
lib/sdk11/components/libraries/bootloader_dfu Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ SD_HEX = $(SD_PATH)/$(SD_FILENAME)_softdevice.hex
2828LD_FILE = $(SRC_PATH ) /linker/$(SD_NAME ) _v$(SD_VER1 ) .ld
2929
3030MERGED_FNAME = $(OUTPUT_FILENAME ) _$(SD_NAME ) _$(SD_VERSION )
31- RELEASE_DIR = bin/$(BOARD ) / $( SD_VERSION )
31+ RELEASE_DIR = bin/$(BOARD )
3232
3333
3434MK_DIS_FIRMWARE = "$(SD_NAME ) $(SD_VERSION ) "
Original file line number Diff line number Diff line change @@ -128,8 +128,9 @@ static void wait_for_events(void)
128128 app_sched_execute ();
129129
130130#ifdef NRF52840_XXAA
131- // usb is not enabled in OTA
132- if ( !is_ota () )
131+ // skip if usb is not inited ( e.g OTA / finializing sd/bootloader )
132+ extern bool usb_inited (void );
133+ if ( usb_inited () )
133134 {
134135 tusb_task ();
135136 tud_cdc_write_flush ();
Original file line number Diff line number Diff line change @@ -65,8 +65,20 @@ extern void tusb_hal_nrf_power_event(uint32_t event);
6565
6666
6767//------------- IMPLEMENTATION -------------//
68+ static bool _inited = false;
69+
70+ bool usb_inited (void )
71+ {
72+ return _inited ;
73+ }
74+
6875void usb_init (bool cdc_only )
6976{
77+ // skipped if already inited
78+ if ( _inited ) return ;
79+
80+ _inited = true;
81+
7082 // USB power may already be ready at this time -> no event generated
7183 // We need to invoke the handler based on the status initially
7284 uint32_t usb_reg ;
You can’t perform that action at this time.
0 commit comments