|
|
@ -109,8 +109,14 @@ static sample_data_filename_t* cratefilename() { |
|
|
|
return &sampledata_file_name; |
|
|
|
} |
|
|
|
|
|
|
|
static void prvf_change_to_standby_state() { poweroff(); } |
|
|
|
static void prvf_change_to_ready_state() { poweron(); } |
|
|
|
static void prvf_change_to_standby_state() { |
|
|
|
poweroff(); |
|
|
|
DeviceCtrl_change_to_state(kdevice_state_standby); |
|
|
|
} |
|
|
|
static void prvf_change_to_ready_state() { |
|
|
|
poweron(); |
|
|
|
DeviceCtrl_change_to_state(kdevice_state_ready); |
|
|
|
} |
|
|
|
static const char* dropstate(uint8_t drop0, uint8_t drop1) { |
|
|
|
static char state[128]; |
|
|
|
sprintf(state, "drop0:%d%d%d%d-%d%d%d%d drop1:%d%d%d%d-%d%d%d%d", // |
|
|
@ -145,6 +151,7 @@ static void app_event_listener(void* p_event_data, uint16_t event_size) { // |
|
|
|
/******************************************************************************* |
|
|
|
* 状态机 * |
|
|
|
*******************************************************************************/ |
|
|
|
// ZLOGI("state %d", m_device_state); |
|
|
|
if (m_device_state == kdevice_state_standby) { |
|
|
|
// 休眠模式现在是深度睡眠,所以永远不会触发这个回调 |
|
|
|
} |
|
|
@ -156,6 +163,7 @@ static void app_event_listener(void* p_event_data, uint16_t event_size) { // |
|
|
|
} |
|
|
|
|
|
|
|
if (event->eventType == kevent_start_sample_cmd_event) { |
|
|
|
ZLOGI("start sample"); |
|
|
|
// SD卡连接到单片机 |
|
|
|
SampleDataMgr_changeToLocalMode(); |
|
|
|
// 创建文件 |
|
|
@ -184,8 +192,8 @@ static void app_event_listener(void* p_event_data, uint16_t event_size) { // |
|
|
|
uint8_t drop0 = hwss_get_drop_state0(); |
|
|
|
uint8_t drop1 = hwss_get_drop_state1(); |
|
|
|
|
|
|
|
if (drop0 || drop1) { |
|
|
|
ZLOGI("drop %s", dropstate(drop0, drop1)); |
|
|
|
if ((drop0 || drop1) && event->eventType == kevent_tmr_scheduler) { |
|
|
|
ZLOGI("[%d] drop %s", znordic_getpower_on_ms(), dropstate(drop0, drop1)); |
|
|
|
} |
|
|
|
|
|
|
|
bool stopcapture = false; |
|
|
|