From 143e22c2d859b9e97f3e3bb5939f6c82d19ed0e3 Mon Sep 17 00:00:00 2001 From: jhchun Date: Thu, 16 Apr 2026 17:39:13 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=84=EC=9B=90=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=EC=9D=84=20=ED=86=B5=ED=95=9C=20=EB=B3=B8=EB=94=A9=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=2010=EC=B4=88=20->=2015=EC=B4=88=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 전원이 꺼진 상태에서 전원 버튼을 15초 이상 누르는 경우 전원 켜짐 + 본딩 삭제 + 전원 꺼짐 --- .../ble_peripheral/ble_app_bladder_patch/main.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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");