Fork of the official mbed C/C++ SDK provides the software platform and libraries to build your applications. The fork has the documentation converted to Doxygen format
Dependents: NervousPuppySprintOne NervousPuppySprint2602 Robot WarehouseBot1 ... more
Fork of mbed by
TimerEvent.h
- Committer:
- screamer
- Date:
- 2012-10-24
- Revision:
- 43:aff670d0d510
- Parent:
- 27:7110ebee3484
File content as of revision 43:aff670d0d510:
/* 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();
/** The head of the list of the events, NULL if none
*/
static TimerEvent *_head;
/** Pointer to the next in the list, NULL if last
*/
TimerEvent *_next;
/** The timestamp at which the even should be triggered
*/
unsigned int _timestamp;
};
} // namespace mbed
#endif
Mihail Stoyanov
