Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 2 months ago.
Why would you need to detach Timeout
If I understand correctly, Timeouts call the interrupt only once after the specified time. If so, then why would you need to detach it? Is it bad if I don't detach it?
If the interrupt is called continuously after the time period, what makes it different from Ticker?
Thanks
Question relating to:
1 Answer
10 years, 2 months ago.
You would normally only do so if you needed to stop the interrupt before it happens.
e.g. If you wanted to put the system to sleep after 30 seconds of idle time then the easiest way is to set a timeout for 30 seconds that then calls your sleep code. If something then happens before the 30 seconds are up you would detach the Timeout.