File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ void usb_teardown(void);
109
109
#define DFU_MAGIC_OTA_RESET 0xA8
110
110
#define DFU_MAGIC_SERIAL_ONLY_RESET 0x4e
111
111
#define DFU_MAGIC_UF2_RESET 0x57
112
+ #define DFU_MAGIC_SKIP 0x6d
112
113
113
114
#define DFU_DBL_RESET_MAGIC 0x5A1AD5 // SALADS
114
115
#define DFU_DBL_RESET_APP 0x4ee5677e
@@ -176,8 +177,10 @@ int main(void)
176
177
bool dfu_start = _ota_dfu || serial_only_dfu || uf2_dfu ||
177
178
(((* dbl_reset_mem ) == DFU_DBL_RESET_MAGIC ) && (NRF_POWER -> RESETREAS & POWER_RESETREAS_RESETPIN_Msk ));
178
179
180
+ bool dfu_skip = (NRF_POWER -> GPREGRET == DFU_MAGIC_SKIP );
181
+
179
182
// Clear GPREGRET if it is our values
180
- if (dfu_start ) NRF_POWER -> GPREGRET = 0 ;
183
+ if (dfu_start || dfu_skip ) NRF_POWER -> GPREGRET = 0 ;
181
184
182
185
// Save bootloader version to pre-defined register, retrieved by application
183
186
// TODO move to CF2
@@ -201,7 +204,7 @@ int main(void)
201
204
202
205
/*------------- Determine DFU mode (Serial, OTA, FRESET or normal) -------------*/
203
206
// DFU button pressed
204
- dfu_start = dfu_start || button_pressed (BUTTON_DFU );
207
+ dfu_start = dfu_start || ( button_pressed (BUTTON_DFU ) && ! dfu_skip );
205
208
206
209
// DFU + FRESET are pressed --> OTA
207
210
_ota_dfu = _ota_dfu || ( button_pressed (BUTTON_DFU ) && button_pressed (BUTTON_FRESET ) ) ;
You can’t perform that action at this time.
0 commit comments