你好,
初始化一个周期定时器,并启动它。但是在定时器处理程序中无法停止此定时器。
1。初始化代码
*启动应用程序计时器*/
如果(wiced_init_
timer(&;app_timer,mesh_app_timer,0,wiced_seconds_periodic_timer)= = wiced_success)
{
如果(wiced_start_timer(&;app_timer,mesh_app_timeout_in_seconds)!= WICEDDY成功
{
WiDeEdBTyTracle(APP启动计时器失败)!!n“”;
}
2。
空隙MeHyAppApTimeT(UTI32)
{
wiced_bt_trace(“mesh_app_timer:计数:%d参数:%dn”,dev_ctx.app_timer_count,Arg);- & gt;虽然停止计时器返回成功。这个调试打印仍然存在。
DavyCTX.AppthimeSerialC++.
WICEDED STOP计时器(和AppSimTime);
γ- IFDEF
/ *转储WICED BT缓存统计每10秒监控缓冲区的使用* /
如果(!)(DeVCCTX.AppTimeTimeRealStCurnal%)
{
A. DeByPrimtBuffiSUSER();
}
第二节
}
以上来自于百度翻译
以下为原文
Hi,
Init a periodic timer, and start it. but this timer cannot be stopped in it's timer handler.
1. init code
/* Starting the app timer */
if ( wiced_init_timer(&app_timer,
mesh_app_timer, 0,
WICED_SECONDS_PERIODIC_TIMER) == WICED_SUCCESS)
{
if ( wiced_start_timer(&app_timer, MESH_APP_TIMEOUT_IN_SECONDS) != WICED_SUCCESS)
{
WICED_BT_TRACE(" APP START Timer FAILED!! n");
}
2.
void
mesh_app_timer(uint32_t arg)
{
WICED_BT_TRACE("mesh_app_timer: count:%d arg:%dn", dev_ctx.app_timer_count, arg);
-> although stop timer returned successfully. this debug print still there.
dev_ctx.app_timer_count++;
wiced_stop_timer(&app_timer);
#ifdef _DEB_PRINT_BUF_USE
/* dump wiced bt buffer statistics on every 10 seconds to monitor buffer usage */
if (!(dev_ctx.app_timer_count % _DEB_PRINT_BUF_USE))
{
_deb_print_buf_use();
}
#endif
}