You are viewing an older revision! See the latest version

Wait

[error loading api]

OS delay

When you call wait the CPU of your mbed will be busy spinning in a loop waiting for the required time to pass. Using the mbed RTOS you can make a call to Thread::wait instead. In this way the OS scheduler will put the current thread in waiting state and it will allow another thread to execute, or even better, if there are not other threads in ready state, it can put the whole microcontroller to sleep saving energy.

Implementation

The timer used to implement this functionality is:

  • On the LPC1768: Timer 3 (LPC_TIM3)
  • On the LPC11U24: 32-bit Counter/Timer B1 (LPC_CT32B1)

All wikipages