|
|
@ -174,6 +174,9 @@ static void app_event_listener(void* p_event_data, uint16_t event_size) { // |
|
|
|
} else if (zble_module_is_connected() && zdatachannel_last_rx_data_haspassed_s() >= BLE_UNCONNECTED_OVERTIME_S) { |
|
|
|
ZLOGI("auto sleep because ble unconnected"); |
|
|
|
prvf_change_to_standby_state(); |
|
|
|
} else if (BoardBattery_get_battery_level() < APP_LOW_BATTERY_LIMIT) { |
|
|
|
ZLOGI("auto sleep because low battery"); |
|
|
|
prvf_change_to_standby_state(); |
|
|
|
} |
|
|
|
|
|
|
|
if (event->eventType == kevent_start_sample_cmd_event) { |
|
|
@ -225,6 +228,9 @@ static void app_event_listener(void* p_event_data, uint16_t event_size) { // |
|
|
|
} else if (m_sample_duration_ms != 0 && DeviceCtrl_cur_state_haspassed_ms() > m_sample_duration_ms) { |
|
|
|
ZLOGI("stop sample because sample timeout"); |
|
|
|
stopcapture = true; |
|
|
|
} else if (BoardBattery_get_battery_level() < APP_LOW_BATTERY_LIMIT) { |
|
|
|
ZLOGI("stop sample because low battery"); |
|
|
|
stopcapture = true; |
|
|
|
} |
|
|
|
#ifdef ENABLE_AUTO_STOP_WHEN_BLE_DISCONNECTED |
|
|
|
else if (zdatachannel_last_rx_data_haspassed_s() > BLE_UNCONNECTED_OVERTIME_S) { |
|
|
@ -294,7 +300,7 @@ void DeviceCtrl_init() { |
|
|
|
// BoardLight_blockFlash(3, 100); |
|
|
|
|
|
|
|
BoardBattery_load(); |
|
|
|
if (BoardBattery_get_battery_level() < APP_LOW_BATTERY_LIMIT) { |
|
|
|
if (BoardBattery_get_battery_level() < APP_LOW_BATTERY_POWER_ON_LIMIT) { |
|
|
|
BoardLight_blockFlash(3, 100); |
|
|
|
|
|
|
|
// 系统进入深度睡眠,进入深度睡眠前,使能唤醒引脚 |
|
|
|