|
|
@ -49,6 +49,7 @@ static sample_data_filename_t sampledata_file_name; |
|
|
|
static void state_machine_driver_tmr_cb(void* p_context) { // |
|
|
|
static app_event_t appevent; |
|
|
|
appevent.eventType = kevent_tmr_scheduler_event; |
|
|
|
wd_feed(); |
|
|
|
AppEvent_pushEvent(&appevent); |
|
|
|
} |
|
|
|
/******************************************************************************* |
|
|
@ -234,6 +235,11 @@ static void app_event_listener(void* p_event_data, uint16_t event_size) { |
|
|
|
// 低电量,设备进入待机模式 |
|
|
|
else if (BoardBattery_get_battery_level() < APP_AUTO_STANDY_BATTERY_LEVEL && ds_cur_state_haspassed_ms() > 3000) { |
|
|
|
state_machine__change_to_standby_state(); |
|
|
|
} // |
|
|
|
|
|
|
|
else if (zble_module_is_connected() && zdatachannel_last_rx_data_haspassed_s() >= BLE_UNCONNECTED_OVERTIME_S) { |
|
|
|
ZLOGI("auto sleep because ble unconnected"); |
|
|
|
state_machine__change_to_standby_state(); |
|
|
|
} |
|
|
|
// ZLOGI("bt:%d plod:%d has_disc:%d state:%d", zdatachannel_is_connected(), BoardEcgSensor_plod_get_connected_state_after_filter(), plod_state_has_disconnected_ms(), ds_cur_state_haspassed_ms()); |
|
|
|
} |
|
|
@ -415,6 +421,8 @@ void one_conduction_main() { |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
wd_init(); |
|
|
|
|
|
|
|
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)); |
|
|
|
|
|
|
|