雷竞技电竞平台对话半导体客户支持- app_timer_set唤醒 https://support.dialog-semiconductor.com/resource-keywords/apptimerset-wakeup 唤醒后app_timer_set()有时工作不正常 https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/after-wakeup-apptimerset-sometimes-work < div class = "字段field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >论坛:,< / div > < div class = "字段条目" > < div class =”field-item甚至“rel = " sioc: has_container " > < a href = " /论坛/ dialog-smartbond-bluetooth-low-energy - % E2 % 80% 93 -软件”“=“sioc:容器sioc:论坛”属性="rdfs:label skos:prefLabel" datatype="">Dialog Smartbond Bluetooth Low Energy - Software< div class="field field-name-body field-type-text-with-summary field-label-hidden">

我修改SDK5.0.4 \ DA1458x_SDK \ 5.0.4 \ target_apps \ ble_examples \ \项目prox_reporter项目。

I set const static sleep_state_t app_default_sleep_mode = ARCH_SLEEP_OFF;

我们使用acc传感器来唤醒设备,app_acc_wakeup_cb()和app_accInt_snifftocwake_cb()被回调,这似乎是正常的。但有时在app_accInt_snifftocwake_cb()函数的app_timer_set(APP_ALG_PERIOD_TASK_TIMER, TASK_APP, 100);异常时,APP_ALG_PERIOD_TASK_TIMER不工作,经过长时间(约5分钟),APP_ALG_PERIOD_TASK_TIMER开始工作。

请给我一些建议!< / p > < p > < / p > < pre > <代码类=“language-cpp”>静态常量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);我+ +; 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: 
2019年3月26日星期二04:03:07 +0000 lewuyouc 296642年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