전원 ON 후 초록 LED 2초간 점등 적용
This commit is contained in:
@@ -33,6 +33,7 @@ static struct k_timer m_power_off_delay_timer; // 전원 OFF 지연 타
|
||||
static struct k_timer m_power_timer; // 전원 시퀀스 반복 타이머
|
||||
|
||||
static struct k_work adv_start_work; // advertising 시작 work
|
||||
static struct k_work_delayable power_on_complete_work; // power on LED done -> advertising start work
|
||||
static struct k_work adv_stop_work; // advertising 중지 work
|
||||
static struct k_work bond_reset_work; // 전원 버튼 15초 롱프레스 본드 삭제 work
|
||||
|
||||
@@ -52,7 +53,16 @@ static void adv_start_work_handler(struct k_work *work)
|
||||
ble_advertising_start();
|
||||
}
|
||||
|
||||
/* 시스템 워크에서 BLE advertising 중지 */
|
||||
/* Power ON LED done -> BLE advertising start */
|
||||
static void power_on_complete_work_handler(struct k_work *work)
|
||||
{
|
||||
ARG_UNUSED(work);
|
||||
led_set_state(LED_STATE_ADVERTISING);
|
||||
k_work_submit(&adv_start_work);
|
||||
battery_timer_start();
|
||||
m_reset_status = 1;
|
||||
}
|
||||
/* BLE advertising stop */
|
||||
static void adv_stop_work_handler(struct k_work *work)
|
||||
{
|
||||
ARG_UNUSED(work);
|
||||
@@ -355,6 +365,7 @@ void power_control_init(void)
|
||||
k_timer_init(&m_power_on_delay_timer, main_s, NULL);
|
||||
k_timer_init(&m_power_off_delay_timer, t_power_off_timeout_handler, NULL);
|
||||
k_work_init(&adv_start_work, adv_start_work_handler);
|
||||
k_work_init_delayable(&power_on_complete_work, power_on_complete_work_handler);
|
||||
k_work_init(&adv_stop_work, adv_stop_work_handler);
|
||||
k_work_init(&bond_reset_work, bond_reset_work_handler);
|
||||
power_timer_init();
|
||||
|
||||
Reference in New Issue
Block a user