Forums: href = " /论坛/ dialog-smartbond-bluetooth-low-energy - % E2 % 80% 93 -软件-对话框- 9 csmartbond % E2 % % E2 % 80% 80% 9 d % E7%B3%BB % E5 % 88% 97% e4%bd % 8 8 e % E5 % % E8 % 9 f % E8 % 80% 97% 93% 9 E2 % d % E7 % 89% 99% 80% 94% e8%bd % AF % E4%BB % B6”“=“sioc:容器sioc:论坛”属性=“rdfs: label skos: prefLabel”数据类型= " " >对话框Smartbond蓝牙低能量-软件/ /对话框“Smartbond”系列低功耗蓝牙——软件< / > < / div > < / div > < / div > < div class =”字段field-name-body field-type-text-with-summary field-label-hidden”> < div class = "字段条目" > < div class =”field-item甚至“财产=“内容:编码”> < p >你的好,我使用的是DA14580, SDK5.0.4 /项目/ target_apps / ble_examples / ble_app_all_in_one。< / p > < p >我使用系统定时函数app_easy_timer(),遇到了一个问题。< br / >我调用这个函数之后,只要加入app_easy_timer_cancel()函数,那么下面的函数只会循环一次。< / p > < p >大概代码如下:< br / > uint16_t receyle_read_timer_hnd = EASY_TIMER_INVALID_TIMER; < br / >空白read_body_sensor_mag_reset (void) < br / > {< br / > arch_printf(“好”);< br / > open_flag = 0; < br / >如果(person_in = = false) < br / > {< br / >如果(GPIO_GetPinStatus (GPIO_BODY_PORT GPIO_BODY_PIN)) / /人感检测到有人< br / > {< br / > arch_printf(“有人\ r \ n”);< br / >init_judege(及magx_init, magy_init,, magz_init); / /地磁数据更新< br / > person_in = true; < br / > cycle_counter = 0; < br / > last_state = person_in;< / div > < div > < / div > < div > < / div > < div > < / div > < div > < / div >< br / > body_time = 0; < br / > send_data [6] = 6; < br / > toilet_indicate_data (send_data 20); < br / > send_data [6] = 0; < br / >如果(receyle_read_timer_hnd ! = EASY_TIMER_INVALID_TIMER) < br / > {< br / > app_easy_timer_cancel (receyle_read_timer_hnd); < br / > receyle_read_timer_hnd = 0; < br / >} < br / >} < br / > else if (cycle_counter祝辞
time_flag = 0;
time_flag = 0;
reset_flag = 0;< br / > body_time = 0; < br / >如果(receyle_read_timer_hnd ! = EASY_TIMER_INVALID_TIMER) < br / > {< br / > app_easy_timer_cancel (receyle_read_timer_hnd); < br / > receyle_read_timer_hnd = 0; < br / >} < br / >} < br / >如果(cycle_counter< 6) < br / > {< br / > cycle_counter + +; < br / > receyle_read_timer_hnd = app_easy_timer(265年,read_body_sensor_mag_reset); < br / >} < br / > }
}