Wiljan Arias / WhexReefMonitor

Dependencies:   mbed-rtos EthernetInterface FatFileSystemCpp MCP23S17 SDFileSystem mbed

Fork of HTTPServerHelloWorld by Donatien Garnier

Committer:
wyunreal
Date:
Sat Feb 01 17:29:15 2014 +0000
Revision:
4:a19825caaf41
Parent:
mbed/TimerEvent.h@3:5dc0023e6284
creating the application model

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wyunreal 3:5dc0023e6284 1 /* mbed Microcontroller Library - TimerEvent
wyunreal 3:5dc0023e6284 2 * Copyright (c) 2007-2009 ARM Limited. All rights reserved.
wyunreal 3:5dc0023e6284 3 * sford
wyunreal 3:5dc0023e6284 4 */
wyunreal 3:5dc0023e6284 5
wyunreal 3:5dc0023e6284 6 #ifndef MBED_TIMEREVENT_H
wyunreal 3:5dc0023e6284 7 #define MBED_TIMEREVENT_H
wyunreal 3:5dc0023e6284 8
wyunreal 3:5dc0023e6284 9 namespace mbed {
wyunreal 3:5dc0023e6284 10
wyunreal 3:5dc0023e6284 11 // Base abstraction for timer interrupts
wyunreal 3:5dc0023e6284 12 class TimerEvent {
wyunreal 3:5dc0023e6284 13
wyunreal 3:5dc0023e6284 14 public:
wyunreal 3:5dc0023e6284 15
wyunreal 3:5dc0023e6284 16 TimerEvent();
wyunreal 3:5dc0023e6284 17
wyunreal 3:5dc0023e6284 18 // The handler registered with the underlying timer interrupt
wyunreal 3:5dc0023e6284 19 static void irq();
wyunreal 3:5dc0023e6284 20
wyunreal 3:5dc0023e6284 21 // Destruction removes it...
wyunreal 3:5dc0023e6284 22 virtual ~TimerEvent();
wyunreal 3:5dc0023e6284 23
wyunreal 3:5dc0023e6284 24 protected:
wyunreal 3:5dc0023e6284 25
wyunreal 3:5dc0023e6284 26 // The handler called to service the timer event of the derived class
wyunreal 3:5dc0023e6284 27 virtual void handler() = 0;
wyunreal 3:5dc0023e6284 28
wyunreal 3:5dc0023e6284 29 // insert in to linked list
wyunreal 3:5dc0023e6284 30 void insert(unsigned int timestamp);
wyunreal 3:5dc0023e6284 31
wyunreal 3:5dc0023e6284 32 // remove from linked list, if in it
wyunreal 3:5dc0023e6284 33 void remove();
wyunreal 3:5dc0023e6284 34
wyunreal 3:5dc0023e6284 35 // Get the current usec timestamp
wyunreal 3:5dc0023e6284 36 static unsigned int timestamp();
wyunreal 3:5dc0023e6284 37
wyunreal 3:5dc0023e6284 38 static TimerEvent *_head; // The head of the list of the events, NULL if none
wyunreal 3:5dc0023e6284 39 TimerEvent *_next; // Pointer to the next in the list, NULL if last
wyunreal 3:5dc0023e6284 40 unsigned int _timestamp; // The timestamp at which the even should be triggered
wyunreal 3:5dc0023e6284 41
wyunreal 3:5dc0023e6284 42 };
wyunreal 3:5dc0023e6284 43
wyunreal 3:5dc0023e6284 44 } // namespace mbed
wyunreal 3:5dc0023e6284 45
wyunreal 3:5dc0023e6284 46 #endif