|
|
@ -59,11 +59,11 @@ static void power_on() { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
hwss_init(); |
|
|
|
BoardBeepCtrl_load(); |
|
|
|
BoardEcgSensor_load(); |
|
|
|
BoardBattery_load(); |
|
|
|
SingleLeadECG_led_init(); |
|
|
|
hwss_init(); |
|
|
|
|
|
|
|
sample_data_mgr_init(); |
|
|
|
dsp_mgr_init(); |
|
|
@ -72,6 +72,7 @@ static void power_on() { |
|
|
|
m_poweronflag = true; |
|
|
|
} |
|
|
|
static void power_off() { |
|
|
|
if (!m_poweronflag) return; |
|
|
|
dsp_mgr_uninit(); |
|
|
|
sample_data_mgr_uninit(); |
|
|
|
hwss_uninit(); |
|
|
@ -137,7 +138,7 @@ void ENTER_DEEP_SLEEP() { |
|
|
|
BoardBattery_sence_gpio_init_before_sleep(); |
|
|
|
// nrf_sdh_disable_request(); |
|
|
|
app_timer_stop_all(); |
|
|
|
nrf_sdh_disable_request(); |
|
|
|
// nrf_sdh_disable_request(); |
|
|
|
sd_power_system_off(); |
|
|
|
NVIC_SystemReset(); |
|
|
|
} |
|
|
@ -168,9 +169,9 @@ static void app_event_listener(void* p_event_data, uint16_t event_size) { |
|
|
|
} |
|
|
|
|
|
|
|
// 10秒后,如果RTC未被设置过,则进入超低功耗 |
|
|
|
else if (ds_cur_state_haspassed_ms() >= 10000) { |
|
|
|
else if (ds_cur_state_haspassed_ms() >= 2000) { |
|
|
|
if (!znordic_rtc_has_setted()) { |
|
|
|
// ENTER_DEEP_SLEEP(); |
|
|
|
ENTER_DEEP_SLEEP(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -381,6 +382,6 @@ void one_conduction_main() { |
|
|
|
ZERROR_CHECK(app_timer_create(&m_state_machine_driver_tmr, APP_TIMER_MODE_REPEATED, state_machine_driver_tmr_cb)); |
|
|
|
ZERROR_CHECK(app_timer_start(m_state_machine_driver_tmr, APP_TIMER_TICKS(300), NULL)); |
|
|
|
|
|
|
|
state_machine__change_to_standby_state(); |
|
|
|
state_machine__change_to_poweroning_state(); |
|
|
|
znordic_loop(); |
|
|
|
} |