Skip to content

Commit d95684c

Browse files
committed
comment out factory reset
1 parent 74c6508 commit d95684c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ void usb_teardown(void);
119119

120120
// Allow for using reset button essentially to swap between application and bootloader.
121121
// 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
122123
#define APP_ASKS_FOR_SINGLE_TAP_RESET() (*((uint32_t*)(USER_FLASH_START + 0x200)) == 0x87eeb07c)
123124

124125
// These value must be the same with one in dfu_transport_ble.c
@@ -167,6 +168,8 @@ void softdev_mbr_init(void)
167168
int main(void)
168169
{
169170
// 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
170173
bootloader_mbr_addrs_populate();
171174

172175
// SD is already Initialized in case of BOOTLOADER_DFU_OTA_MAGIC
@@ -188,9 +191,6 @@ int main(void)
188191
// Save bootloader version to pre-defined register, retrieved by application
189192
BOOTLOADER_VERSION_REGISTER = (MK_BOOTLOADER_VERSION);
190193

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-
194194
board_init();
195195
bootloader_init();
196196

@@ -271,11 +271,13 @@ int main(void)
271271
}
272272
}
273273

274+
#if 0
274275
// Adafruit Factory reset
275276
if ( !button_pressed(BUTTON_DFU) && button_pressed(BUTTON_FRESET) )
276277
{
277278
adafruit_factory_reset();
278279
}
280+
#endif
279281

280282
// Reset Board
281283
board_teardown();
@@ -300,6 +302,7 @@ int main(void)
300302
}
301303

302304

305+
#if 0
303306
// Perform factory reset to erase Application + Data
304307
void adafruit_factory_reset(void)
305308
{
@@ -317,6 +320,7 @@ void adafruit_factory_reset(void)
317320
// back to normal
318321
led_state(STATE_FACTORY_RESET_FINISHED);
319322
}
323+
#endif
320324

321325
/**
322326
* Initializes the SoftDevice and the BLE event interrupt.

0 commit comments

Comments
 (0)