BUG REPORT multi periodic app_easy_timer callback bug

12个帖子/ 0新
最后一篇
强奸
离线
最后一次露面:3 years 3 months ago
加入:2015-05-12 09:55
BUG REPORT multi periodic app_easy_timer callback bug

我有3个由app_easy_time声明的计时器是周期性的一秒,第二个是在某些情况下调用的,最后一个在随机时间呼叫epy 30秒。
With this three timer,the second timer callback is called not correctly ocassionly .I believe it is called by the first periodic timer.
如果我只使用前两个计时器,eveything似乎可以。

更新:一些简化的代码iLustring我的计时器设置,错误地触发汉勒问题是我的错,而另一个问题发生了另一个问题。

静态void app_watchdog_second_timer_handler()//调用每秒,
{
second_coun++;
app_watchdog_second_timer = app_easy_timer(100,app_watchdog_second_timer_handler);// 1000女士

if(second_count == 10)
{
uint32_t delay =(co_rand_byte()%20)* 10 + 30;
APP_SEND_DATA_TIMER = app_easy_timer( delay, sendSensorDataHandler);

}

if(sign_count == 30)//期间为30秒
{
second_coun = 0;
}

}

void sendsensordatahandler(void)//在一段时间内致电
{
app_send_data_timer = easy_timer_invalid_timer;//这条行地址我以前的问题,现在定时器触发正确的处理程序
}

Void ResetsendData(Void)//触发器在某些条件下
{
if(app_send_data_timer!= eyle_timer_invalid_timer)//此行地址我以前的问题,现在Timer触发正确的处理程序
{
// ----------another problem occur here ,this functionocassionly delete my APP_WATCHDOG_SECOND_TIMER resulting no timers running ,and I check the timer_callbacks[APP_TIMER_MAX_NUM] ,empty

APP_SEND_DATA_TIMER = app_easy_timer_modify(APP_SEND_DATA_TIMER , RESET_SEND_DATA_TIME + (co_rand_byte() % 20) * 10);
}

}

Device:
mt_dialog.
离线
最后一次露面:2个月1周前
职员
加入:2015-06-08 11:34
嗨Tengworld,

嗨Tengworld,

Can you give me some more details about your setup? I set 3 timers 1) 60 seconds, 2) 30 seconds and 3) incremented delay. All of them seem to went of on time. In your test, if i undestood correctly it seems that one timer triggers the wrong handler, is that correct ?

谢谢mt_dialog.

强奸
离线
最后一次露面:3 years 3 months ago
加入:2015-05-12 09:55
thank you ,I have upload some

thank you ,I have upload some simplified code ilustrting my timer setup,the wrongly triggerd hanler problem was my fault,but another problem occurs,
by the way,in csr api, callback have timerid parameter for avoid racing coditon,in easy timer,is it ok without this?
typedef void(* timer_callback_arg)(timer_id const)
timer_id timercreate(uint32 const time,bool const相对,timer_callback_arg处理程序)

mt_dialog.
离线
最后一次露面:2个月1周前
职员
加入:2015-06-08 11:34
嗨Tengworld,

嗨Tengworld,

If i undestood correctly the app_easy_timer_modify(); instead of modifying your timer it deletes another timer ? Are you able to verify the value that passes to the app_easy_timer_modify and check the id of the handler passed to function. I ve tried the app_easy_timer_modify, it doesn't cancel the timer. You can try implement something simpler in order to try like this:

void testing_timer_handler1(void)
{
testing_timer1 = easy_timer_invalid_timer;
if(testing_timer!= easy_timer_invalid_timer)
{
testing_timer = app_easy_timer_modify(tests_timer,reset_send_data_time +(co_rand_byte()%20)* 10);
}
testing_timer1 = app_easy_timer(60,testing_timer_handler1);
}

void testing_timer_handler(void)
{
if(testing_timer!= easy_timer_invalid_timer)
{
testing_timer = EASY_TIMER_INVALID_TIMER;
arch_set_pxact_gpio();
}
}

谢谢mt_dialog.

Mahesh.
离线
最后一次露面:3 years 3 months ago
加入:2016-01-04 14:03
你好,

你好,
I am using SDK 5.0.3 software on DA14583DEVKT-B board.
我拍摄了“BLE_APP_PERITELAL”(给出了BLE示例项目)。

Modified to support two characteristics. Need to send the data at every 10 milli seconds and 30 milli seconds through characteristics 1 and characteristics 2 respectively to the mobile.

In every one cycle operation, I need to get the 1 packet of data-I and 3 packets of data-II (i.e. for the duration of 30 milli seconds). But I am receiving 1 packet of data-1 and 2 packets of data-II.
“app_easy_timer(app_peripheral_ctrl_timer_delay,dataval1timercbhandler)”和“app_easy_timer(app_peripheral_ctrl_timer_delay2,dataval2timercbhandler)”用于触发定期呼叫。

请帮我解决这个问题。

Regards,
Mahesh Chandana。

mt_dialog.
离线
最后一次露面:2个月1周前
职员
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

Please check the following posthttp://support.dialog-semicondiondionder.com/whats-kernel-timer- accuracy.

谢谢mt_dialog.

Mahesh.
离线
最后一次露面:3 years 3 months ago
加入:2016-01-04 14:03
你好,

你好,
我使用“BLE_APP_PERITERAL”(给定的BLE示例项目)代码。
我需要以下信息,这将是有用的
1. As of now I can able achieve minimum 10 millisecond only. Is there any possibility to increase the scheduling frequency of the kernel timer (i.e. app_easy_timer() ).
2.我希望在我的申请中使用队列实现。请指导我如何创建和使用队列。
3.根据我的应用要求,我需要将传感器数据发送到内核(用于通过BLE传输),当数据可用时。无论我是否可以调用“KE_MSG_SEND(REQ)”,当我有传感器数据时。是否存在任何约束和限制。两个连续数据包或消息到内核所需的最短时间是多少。

Regards,
Mahesh Chandana。

mt_dialog.
离线
最后一次露面:2个月1周前
职员
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

1. I dont get what you mean by scheduling frequency, all the messages are scheduled when the code goes through the rwip_schedule() in the main loop. There is no way to increase the resolution of the kernel timer at the moment, if that is what you mean.

2.您可以在RW-BT-Kernel-SW-FS中找到有关RW内核的信息。

3.正如上面我已经提到,消息the kernel are scheduled through the rwip_schedule(), how frequent this function executes depends on the that loop, if the system decides to go to sleep or not and the functionallity of the app_asynch_trm() function (app_on_ble_powered). If the app_on_ble_powered return GOTO_SLEEP the device will continue, make the appropriate sleep checks and go into sleep, if it returns KEEP_POWERED this will force the scheduler to run again.

谢谢mt_dialog.

Mahesh.
离线
最后一次露面:3 years 3 months ago
加入:2016-01-04 14:03
你好,

你好,
Thank you for quick response.
是否可以以单个连接间隔发送多个(即多个)通知数据。

Regards,
Mahesh Chandana。

mt_dialog.
离线
最后一次露面:2个月1周前
职员
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

是的,您可能不必做任何特殊的事情,只需在您想要的时间间隔内发送通知,并且堆栈将更多地发送一个数据包如果队列中有多个通知。关于在一个连接间隔中可以发送多少个数据包请检查下一个线程http://support.dialog-semicondiondiondum/number-packets-connection-event.

谢谢mt_dialog.

Mahesh.
离线
最后一次露面:3 years 3 months ago
加入:2016-01-04 14:03
你好,

你好,
当我发送启用通知时(即,从移动到服务器的写入请求(即1值),它是可在服务器端(即user_catch_rest_hndl())收缩。但是,当我发送禁用通知时(即从移动到服务器的写入请求(即0值)),我无法在服务器端接收(即user_catch_rest_hndl())。

我需要指示(在服务器端),当我接受禁用通知时。我怀疑它是在内核层面的处理。
我如何确定禁用通知的接收。

Regards,
Mahesh Chandana。

mt_dialog.
离线
最后一次露面:2个月1周前
职员
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

当一个中央写入特性时,您在应用程序中找到指示,例如在BLE_APP_PERITELAL项目中,您应该能够在USER_CATCH_REST_HNDL()函数中捕获CUST1_IDX_ADC_VAL_1_NTF_CFG案例,当您将此指示达到您的应用程序时,您可以检查是否参数的值具有prf_cli_start_ntf或prf_cli_stop_ntfind。

谢谢mt_dialog.