wiced_rtos_delay_milliseconds

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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

0 Likes
2 Replies
SeyhanA_31
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

Hi,

Do you mean, return from the delay prematurely before the time is up, no.

The sleep/delay thread handles the requested delay, depending of the RTOS.

Seyhan

0 Likes
Anonymous
Not applicable

Discussion is being locked. If you have any follow-up, please start a new discussion.

0 Likes