File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ void usb_teardown(void);
105105#define DFU_MAGIC_UF2_RESET 0x57
106106
107107#define DFU_DBL_RESET_MAGIC 0x5A1AD5 // SALADS
108+ #define DFU_DBL_RESET_APP 0x4ee5677e
108109#define DFU_DBL_RESET_DELAY 500
109110#define DFU_DBL_RESET_MEM 0x20007F7C
110111
@@ -197,9 +198,10 @@ int main(void)
197198 _ota_dfu = _ota_dfu || ( button_pressed (BUTTON_DFU ) && button_pressed (BUTTON_FRESET ) ) ;
198199
199200 bool const valid_app = bootloader_app_is_valid (DFU_BANK_0_REGION_START );
201+ bool const just_start_app = valid_app && !dfu_start && (* dbl_reset_mem ) == DFU_DBL_RESET_APP ;
200202
201203 // App mode: register 1st reset and DFU startup (nrf52832)
202- if ( ! (dfu_start || !valid_app ) )
204+ if ( ! (just_start_app || dfu_start || !valid_app ) )
203205 {
204206 // Register our first reset for double reset detection
205207 (* dbl_reset_mem ) = DFU_DBL_RESET_MAGIC ;
You can’t perform that action at this time.
0 commit comments