@@ -119,6 +119,7 @@ void usb_teardown(void);
119
119
120
120
// Allow for using reset button essentially to swap between application and bootloader.
121
121
// This is controlled by a flag in the app and is the behavior of CPX and all Arcade boards when using MakeCode.
122
+ // TODO correct USER_FLASH_START = APP after SoftDevice
122
123
#define APP_ASKS_FOR_SINGLE_TAP_RESET () (*((uint32_t*)(USER_FLASH_START + 0x200)) == 0x87eeb07c)
123
124
124
125
// These value must be the same with one in dfu_transport_ble.c
@@ -167,6 +168,8 @@ void softdev_mbr_init(void)
167
168
int main (void )
168
169
{
169
170
// Populate Boot Address and MBR Param if not already
171
+ // Happens if flashing SD hex that overwrite current MBR
172
+ // MBR_BOOTLOADER_ADDR/MBR_PARAM_PAGE_ADDR are used if available, else UICR registers are used
170
173
bootloader_mbr_addrs_populate ();
171
174
172
175
// SD is already Initialized in case of BOOTLOADER_DFU_OTA_MAGIC
@@ -188,9 +191,6 @@ int main(void)
188
191
// Save bootloader version to pre-defined register, retrieved by application
189
192
BOOTLOADER_VERSION_REGISTER = (MK_BOOTLOADER_VERSION );
190
193
191
- // This check ensures that the defined fields in the bootloader corresponds with actual setting in the chip.
192
- APP_ERROR_CHECK_BOOL (* ((uint32_t * )NRF_UICR_BOOT_START_ADDRESS ) == BOOTLOADER_REGION_START );
193
-
194
194
board_init ();
195
195
bootloader_init ();
196
196
@@ -271,11 +271,13 @@ int main(void)
271
271
}
272
272
}
273
273
274
+ #if 0
274
275
// Adafruit Factory reset
275
276
if ( !button_pressed (BUTTON_DFU ) && button_pressed (BUTTON_FRESET ) )
276
277
{
277
278
adafruit_factory_reset ();
278
279
}
280
+ #endif
279
281
280
282
// Reset Board
281
283
board_teardown ();
@@ -300,6 +302,7 @@ int main(void)
300
302
}
301
303
302
304
305
+ #if 0
303
306
// Perform factory reset to erase Application + Data
304
307
void adafruit_factory_reset (void )
305
308
{
@@ -317,6 +320,7 @@ void adafruit_factory_reset(void)
317
320
// back to normal
318
321
led_state (STATE_FACTORY_RESET_FINISHED );
319
322
}
323
+ #endif
320
324
321
325
/**
322
326
* Initializes the SoftDevice and the BLE event interrupt.
0 commit comments