COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Event.cpp
Go to the documentation of this file.
1
21
#include "
Cosa/Event.hh
"
22
#include "
Cosa/Watchdog.hh
"
23
24
Queue<Event, Event::QUEUE_MAX>
Event::queue
;
25
26
bool
27
Event::service
(uint32_t ms)
28
{
29
uint32_t start =
Watchdog::millis
();
30
Event
event;
31
while
(!
queue
.
dequeue
(&event)) {
32
if
((ms == 0L) || (
Watchdog::since
(start) < ms))
33
yield
();
34
else
35
return
(
false
);
36
}
37
event
.dispatch();
38
return
(
true
);
39
}
40
Queue::dequeue
bool dequeue(T *data)
Definition:
Queue.hh:145
Watchdog::millis
static uint32_t millis()
Definition:
Watchdog.hh:51
Event.hh
Event::queue
static Queue< Event, QUEUE_MAX > queue
Definition:
Event.hh:204
Watchdog::since
static uint32_t since(uint32_t start)
Definition:
Watchdog.hh:108
Queue
Definition:
Queue.hh:35
yield
void(* yield)()
Event
Definition:
Event.hh:39
Watchdog.hh
Event::service
static bool service(uint32_t ms=0L)
Definition:
Event.cpp:27
cores
cosa
Cosa
Event.cpp
Generated on Thu Aug 31 2017 17:02:02 for COSA by
1.8.11