|
|
@ -56,8 +56,8 @@ static void zble_event_listener(zble_event_t* ble_event) { // |
|
|
|
/******************************************************************************* |
|
|
|
* 事件处理 * |
|
|
|
*******************************************************************************/ |
|
|
|
static bool m_ispoweron = false; |
|
|
|
//static bool m_drop_state_triggered = false; |
|
|
|
static bool m_ispoweron = false; |
|
|
|
// static bool m_drop_state_triggered = false; |
|
|
|
static void poweroff() { |
|
|
|
if (!m_ispoweron) return; |
|
|
|
BoardBeepCtrl_unload(); |
|
|
@ -139,12 +139,12 @@ static void prvf_change_to_sample_state() { // |
|
|
|
|
|
|
|
static void app_event_listener(void* p_event_data, uint16_t event_size) { // |
|
|
|
app_event_t* event = (app_event_t*)p_event_data; |
|
|
|
//static bool inited; |
|
|
|
// if (!inited) { |
|
|
|
// nrf_gpio_cfg_input(BUTTON_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
// inited = true; |
|
|
|
// } |
|
|
|
// ZLOGI("button %d", nrf_gpio_pin_read(BUTTON_PIN)); |
|
|
|
// static bool inited; |
|
|
|
// if (!inited) { |
|
|
|
// nrf_gpio_cfg_input(BUTTON_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
// inited = true; |
|
|
|
// } |
|
|
|
// ZLOGI("button %d", nrf_gpio_pin_read(BUTTON_PIN)); |
|
|
|
|
|
|
|
/******************************************************************************* |
|
|
|
* 状态无关事件处理 * |
|
|
@ -167,10 +167,15 @@ static void app_event_listener(void* p_event_data, uint16_t event_size) { // |
|
|
|
|
|
|
|
// |
|
|
|
else if (m_device_state == kdevice_state_ready) { |
|
|
|
/******************************************************************************* |
|
|
|
* 永不休眠 * |
|
|
|
*******************************************************************************/ |
|
|
|
#if 0 |
|
|
|
if (!zble_module_is_connected() && DeviceCtrl_cur_state_haspassed_ms() > APP_AUTO_SLEEP_TIMEOUT_MS) { |
|
|
|
ZLOGI("auto sleep"); |
|
|
|
prvf_change_to_standby_state(); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
if (event->eventType == kevent_start_sample_cmd_event) { |
|
|
|
ZLOGI("start sample"); |
|
|
|