What is the proper way to delay?

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

cross mob
MaWa_4506761
Level 2
Level 2
10 replies posted 5 replies posted 5 questions asked

I have been using Cy_SysLib_Delay() to wait. In my effort to use more MBedOS calls, I found wait_ms. In trying to use it, I've found some sort of conflict between wait_ms and us_ticker_read. Also, I found in the wait documentation on MBedOS that the wait family of functions prevents deep sleep from occurring. An alternative would be to split up my code and then use LowPowerTimeout that would call another function to continue operation.

What is the correct way to wait? Is there a way to wait that allows the processor to enter deep sleep mode?

EDIT: I'm using MBedOS 5.12

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello,

Whats the version of Mbed OS you are using? But to answer your question, you can make use of thread_sleep_for Mbed API. Regarding putting the processor to deep-sleep you need to use Mbed Tickless mode. For more information refer to the section MBEDOS at this link: Low Power Assistant Middleware Library 3.0.0: Low Power Assistant Middleware Library 3.0.0

Regards,

Dheeraj

View solution in original post

1 Reply
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello,

Whats the version of Mbed OS you are using? But to answer your question, you can make use of thread_sleep_for Mbed API. Regarding putting the processor to deep-sleep you need to use Mbed Tickless mode. For more information refer to the section MBEDOS at this link: Low Power Assistant Middleware Library 3.0.0: Low Power Assistant Middleware Library 3.0.0

Regards,

Dheeraj