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.
Dependencies: mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac
Diff: mbed/TimerEvent.h
- Revision:
- 17:d1594579eec6
- Parent:
- 0:ad97421fb1fb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed/TimerEvent.h Fri May 19 17:14:07 2017 +0000
@@ -0,0 +1,45 @@
+/* mbed Microcontroller Library - TimerEvent
+ * Copyright (c) 2007-2009 ARM Limited. All rights reserved.
+ */
+
+#ifndef MBED_TIMEREVENT_H
+#define MBED_TIMEREVENT_H
+
+namespace mbed {
+
+// Base abstraction for timer interrupts
+class TimerEvent {
+
+public:
+
+ TimerEvent();
+
+ // The handler registered with the underlying timer interrupt
+ static void irq();
+
+ // Destruction removes it...
+ virtual ~TimerEvent();
+
+protected:
+
+ // The handler called to service the timer event of the derived class
+ virtual void handler() = 0;
+
+ // insert in to linked list
+ void insert(unsigned int timestamp);
+
+ // remove from linked list, if in it
+ void remove();
+
+ // Get the current usec timestamp
+ static unsigned int timestamp();
+
+ static TimerEvent *_head; // The head of the list of the events, NULL if none
+ TimerEvent *_next; // Pointer to the next in the list, NULL if last
+ unsigned int _timestamp; // The timestamp at which the even should be triggered
+
+};
+
+} // namespace mbed
+
+#endif