DFU activation 후 App 부팅 시 전원 OFF 처리 추가
This commit is contained in:
@@ -181,6 +181,7 @@
|
||||
#define POWER_OFF_DELAY 3000 /* Power-off delay: 3s after LED indication */
|
||||
#define POWER_RESET_DELAY 2000 /* Reset delay: 2s */
|
||||
#define LED_NUM 24 /* LED pin number */
|
||||
#define POST_DFU_APP_BOOT_GPREGRET2_MASK 0x02U /* Bootloader marker after DFU activation */
|
||||
|
||||
/*==============================================================================
|
||||
* BLE Instances (statically allocated via SoftDevice macros)
|
||||
@@ -2182,6 +2183,17 @@ int main(void)
|
||||
*────────────────────────────────────────────────────────────*/
|
||||
power_hold_init();
|
||||
|
||||
if ((NRF_POWER->GPREGRET2 & POST_DFU_APP_BOOT_GPREGRET2_MASK) != 0)
|
||||
{
|
||||
NRF_POWER->GPREGRET2 &= ~POST_DFU_APP_BOOT_GPREGRET2_MASK;
|
||||
NRF_P0->OUTCLR = (1UL << 8);
|
||||
NRF_P0->DIRSET = (1UL << 8);
|
||||
while (true)
|
||||
{
|
||||
__WFE();
|
||||
}
|
||||
}
|
||||
|
||||
if (power_off_duble_prohibit)
|
||||
{
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user