Skip to content

Commit

Permalink
Increase the priority of entering boot mode via button press. (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
lihuanhuan authored Jan 31, 2024
1 parent b7c405d commit 495ba0e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ble-firmware/components/libraries/bootloader/nrf_bootloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,19 +354,19 @@ static void dfu_enter_flags_clear(void)
*/
static bool dfu_enter_check(void)
{
if (!app_is_valid(crc_on_valid_app_required()))
{
NRF_LOG_DEBUG("DFU mode because app is not valid.");
return true;
}

if (NRF_BL_DFU_ENTER_METHOD_BUTTON &&
(nrf_gpio_pin_read(NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN) == 0))
{
NRF_LOG_DEBUG("DFU mode requested via button.");
button_dfu_flag = 1;
return true;
}

if (!app_is_valid(crc_on_valid_app_required()))
{
NRF_LOG_DEBUG("DFU mode because app is not valid.");
return true;
}

if (NRF_BL_DFU_ENTER_METHOD_PINRESET &&
(NRF_POWER->RESETREAS & POWER_RESETREAS_RESETPIN_Msk))
Expand Down

0 comments on commit 495ba0e

Please sign in to comment.