Programme d'utilisation servomotors MX12 V1

Committer:
R66Y
Date:
Fri May 19 14:32:14 2017 +0000
Revision:
0:80df663dd15e
programme pour utiliser les servomoteurs MX12.

Who changed what in which revision?

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