2 Replies Latest reply on Jun 17, 2015 9:52 AM by hmoore

    wiced_rtos_delay_milliseconds

    sungjunhyuk

      wiced_rtos_delay_milliseconds(WIFI_SLEEP_TIME);

       

      wwd_result_t host_rtos_delay_milliseconds( uint32_t num_ms )

      {

          //WPRINT_APP_INFO(("Timer Start\n"));

          if ( ( num_ms * SYSTICK_FREQUENCY / 1000 ) != 0 )

          {

              if ( ( tx_thread_sleep( (ULONG) ( num_ms * SYSTICK_FREQUENCY / 1000 ) ) ) != TX_SUCCESS )

              {

                  return WWD_SLEEP_ERROR;

              }

          }

          else

          {

              uint32_t time_reference = host_platform_get_cycle_count( );

              int32_t wait_time       = (int32_t)num_ms * CPU_CLOCK_HZ / 1000;

              //WPRINT_APP_INFO(("Timer Start\n"));

              while ( wait_time > 0 )

              {

                  uint32_t current_time = host_platform_get_cycle_count( );

                  wait_time            -= (int32_t)( current_time - time_reference );

                  time_reference        = current_time;

              }

          }

          return WWD_SUCCESS;

      }

       

      When using the above function enters the sleep mode, using an external interrupt

      Is there a way to wake-up ??

       

      enviroment :

      WICED v3.1.1

      RTOS ThreadX v5.6

      NetX v5.7_sp1