diff --git a/project/ble_peripheral/ble_app_bladder_patch/main.c b/project/ble_peripheral/ble_app_bladder_patch/main.c index 4685fff..5cee1ad 100644 --- a/project/ble_peripheral/ble_app_bladder_patch/main.c +++ b/project/ble_peripheral/ble_app_bladder_patch/main.c @@ -1617,7 +1617,7 @@ static void main_s(void * p_context) if (!button_released) { cnt_s++; - if (cnt_s == 400) /* 400 x 5ms = 2000ms = 2s */ + if (cnt_s == 400) /* 400 x 5ms = 2s */ { DBG_PRINTF("[BTN] Power OFF\r\n"); led_set_state(LED_STATE_POWER_OFF); @@ -1628,7 +1628,7 @@ static void main_s(void * p_context) } else { - cnt_s = 0; /* Counter reset when button is not pressed */ + cnt_s = 0; } timers_start(); return; @@ -1643,21 +1643,19 @@ static void main_s(void * p_context) power_control_handler(OFF); cnt_s = 0; } - else if (cnt_s > 2000) /* Bonding delete */ + else if (cnt_s > 3000) /* 3000 x 5ms = 15s */ { - DBG_PRINTF("[BTN] Bonding Deleted\r\n"); + DBG_PRINTF("[BTN] Bond Delete\r\n"); power_control_handler(ON); nrf_delay_ms(100); bond_data_delete = true; m_config.bond_data_delete = (uint8_t)bond_data_delete; - //const char pass_init[PASSKEY_LENGTH] = DEFAULT_PASSKEY; - //memcpy(m_config.static_passkey, pass_init, PASSKEY_LENGTH); /* passkey reset */ config_save(); nrf_delay_ms(1000); go_device_power_off = true; main_timer_start(); } - else if (cnt_s > 400 || (m_reset_status == 2)) + else if (cnt_s > 400 || (m_reset_status == 2)) /* 400 x 5ms = 2s */ { DBG_PRINTF("[BTN] Boot (cnt=%d)\r\n", cnt_s); device_reset = false; @@ -1686,7 +1684,7 @@ static void main_s(void * p_context) cnt_s++; device_reset = false; - if (cnt_s == 400) + if (cnt_s == 400) /* 400 x 5ms = 2s */ { led_set_state(LED_STATE_POWER_ON); DBG_PRINTF("[BTN] 2.0s\r\n");