Skip to content

Commit a678d4e

Browse files
committed
tusb_hal_millis not available in DFU. Use _systick_count
1 parent 5a2f115 commit a678d4e

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/sdk11/components/libraries/bootloader_dfu/bootloader.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ extern void tud_vendor_task(void);
144144
(m_update_status == BOOTLOADER_TIMEOUT) ||
145145
(m_update_status == BOOTLOADER_RESET) )
146146
{
147-
extern uint32_t tusb_hal_millis(void);
147+
extern uint32_t _systick_count;
148148
if (m_update_status == BOOTLOADER_COMPLETE) {
149149
static uint32_t finishedTime = 0;
150150
if (finishedTime == 0)
151-
finishedTime = tusb_hal_millis() + 500;
152-
if (tusb_hal_millis() > finishedTime)
151+
finishedTime = _systick_count + 500;
152+
if (_systick_count > finishedTime)
153153
return;
154154
}
155155
else

src/boards/boards.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void board_teardown(void)
108108
NRF_CLOCK->TASKS_LFCLKSTOP = 1UL;
109109
}
110110

111-
static uint32_t _systick_count = 0;
111+
uint32_t _systick_count = 0;
112112
void SysTick_Handler(void)
113113
{
114114
_systick_count++;

src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void usb_teardown(void);
8787
#include "dfu_qspi.h"
8888
#include "dfu_uart.h"
8989

90-
#define BOOTLOADER_VERSION 0x0802
90+
#define BOOTLOADER_VERSION 0x0803
9191
// found in BOOTLOADER_VER_MEM 0x200041D0
9292

9393
//--------------------------------------------------------------------+
@@ -399,7 +399,7 @@ else
399399
bootloader_app_start();
400400
}
401401

402-
// NVIC_SystemReset();
402+
NVIC_SystemReset();
403403
}
404404

405405
/**

0 commit comments

Comments
 (0)