1 Reply Latest reply on Jun 24, 2018 9:18 PM by AbhishekK_31

    PERIODIC TIMER cannot be stopped in it's timer handler (cyw20719)

    NiLi_2861801

      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:%d\n", 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

      }