yabo国际娱乐对话框半导体客户支持- app_timer_set wakeup https://support.dialog-semiconductor.com/resource-keywords/apptimerset-wakeup en after wakeup app_timer_set() sometimes work abnormal https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/after-wakeup-apptimerset-sometimes-work

Hi

I modify SDK 5.0.4\DA1458x_SDK\5.0.4\projects\target_apps\ble_examples\prox_reporter project.

I set const static sleep_state_t app_default_sleep_mode = ARCH_SLEEP_OFF;.user_default_hnd_conf.adv_scenario = DEF_ADV_FOREVER,

I use in our new made board, we use set_device_to_sleep() function set device to extended sleep mode,

we use acc sensor to wakeup device, the app_acc_wakeup_cb() and app_accInt_snifftocwake_cb() was callback,it is seem normal.

But sometimes in app_accInt_snifftocwake_cb() function the app_timer_set(APP_ALG_PERIOD_TASK_TIMER, TASK_APP, 100); is abnormal, the APP_ALG_PERIOD_TASK_TIMER do not work, after a long time(about five minutes),the APP_ALG_PERIOD_TASK_TIMER start to work.

please give me some suggest!

 static const struct ke_msg_handler app_custs1_process_handlers[] = { {APP_ALG_PERIOD_TASK_TIMER, (ke_msg_func_t)app_alg_period_task_timer_handler}, {CUSTS1_CREATE_DB_CFM, (ke_msg_func_t)app_custs1_create_db_cfm_handler}, {CUSTS1_DISABLE_IND, (ke_msg_func_t)app_custs1_disable_ind_handler}, }; static int app_alg_period_task_timer_handler(ke_msg_id_t const msgid, void const *param, ke_task_id_t const dest_id, ke_task_id_t const src_id) { static int i=0; app_timer_set(APP_ALG_PERIOD_TASK_TIMER, dest_id, 100); i++; arch_printf("i=%d\r\n",i); test_ble_send_data_function(); return (KE_MSG_CONSUMED); } void set_device_to_sleep(void) { arch_printf("set_device_to_sleep\r\n"); if(ke_timer_active(APP_ALG_PERIOD_TASK_TIMER,TASK_APP)){ ke_timer_clear(APP_ALG_PERIOD_TASK_TIMER,TASK_APP); } if(ke_state_get(TASK_APP)==APP_CONNECTED){ disconnect_no_adv_flag = 1; app_easy_gap_disconnect(save_connection_idx); } app_easy_gap_advertise_stop(); hsppad042a_standby(); hsactd_set_to_sniff(); arch_ble_ext_wakeup_on(); app_accInt_wakeup_enable(); arch_set_extended_sleep(); } static void app_acc_wakeup_cb(void) { disconnect_no_adv_flag = 0; default_advertise_operation(); arch_printf("app_acc_wakeup_cb"); } static void app_accInt_snifftocwake_cb(void) { if (GetBits16(SYS_STAT_REG, PER_IS_DOWN)) { periph_init(); } if (arch_ble_ext_wakeup_get()) { arch_disable_sleep(); arch_ble_force_wakeup(); arch_ble_ext_wakeup_off(); app_easy_wakeup(); } hsactd003a_readsteate_clear_pending(); arch_printf("app_accInt_snifftocwake_cb\r\n"); app_timer_set(APP_ALG_PERIOD_TASK_TIMER, TASK_APP, 100); app_accInt_wakeup_enable(); } void app_accInt_wakeup_enable(void) { app_easy_wakeup_set(app_acc_wakeup_cb); wkupct_register_callback(app_accInt_snifftocwake_cb); // if (!GPIO_GetPinStatus(GPIO_ACCINT_PORT, GPIO_ACCINT_PIN)) { wkupct_enable_irq(WKUPCT_PIN_SELECT(GPIO_ACCINT_PORT, GPIO_ACCINT_PIN), // select pin WKUPCT_PIN_POLARITY(GPIO_ACCINT_PORT, GPIO_ACCINT_PIN, WKUPCT_PIN_POLARITY_HIGH), 1, // 1 event 3); // debouncing time = 0 } } 

Device: 
Tue, 26 Mar 2019 04:03:07 +0000 lewuyouc 296642 at https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/after-wakeup-apptimerset-sometimes-work#comments