Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed by
Diff: Timeout.h
- Revision:
- 11:1c1ebd0324fa
- Parent:
- 9:cf0d45ce28a6
- Child:
- 27:7110ebee3484
diff -r fcb9359f0959 -r 1c1ebd0324fa Timeout.h
--- a/Timeout.h Thu May 14 14:44:00 2009 +0000
+++ b/Timeout.h Fri Aug 28 12:10:11 2009 +0000
@@ -1,7 +1,8 @@
/* mbed Microcontroller Library - Timeout
- * Copyright (c) 2007-2008, sford
- */
-
+ * Copyright (c) 2007-2009 ARM Limited. All rights reserved.
+ * sford
+ */
+
#ifndef MBED_TIMEOUT_H
#define MBED_TIMEOUT_H
@@ -13,6 +14,28 @@
* A Timeout is used to call a function at a point in the future
*
* You can use as many seperate Timeout objects as you require.
+ *
+ * Example:
+ * > // Blink until timeout.
+ * >
+ * > #include "mbed.h"
+ * >
+ * > Timeout timeout;
+ * > DigitalOut led(LED1);
+ * >
+ * > int on = 1;
+ * >
+ * > void attimeout() {
+ * > on = 0;
+ * > }
+ * >
+ * > int main() {
+ * > timeout.attach(&attimeout, 5);
+ * > while(on) {
+ * > led = !led;
+ * > wait(0.2);
+ * > }
+ * > }
*/
class Timeout : public Ticker {
@@ -77,10 +100,10 @@
protected:
- virtual void handler();
-
-};
+ virtual void handler();
-}
+};
+
+} // namespace mbed
#endif
