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.
main.cpp
00001 #include "mbed_events.h" 00002 #include <stdio.h> 00003 00004 /** 00005 Event queues easily align with module boundaries, where internal state can be 00006 implicitly synchronized through event dispatch. Multiple modules can use 00007 independent event queues, but still be composed through the EventQueue::chain function. 00008 **/ 00009 00010 int main() { 00011 // Create some event queues with pending events 00012 EventQueue a; 00013 a.call(printf, "hello from a!\n"); 00014 00015 EventQueue b; 00016 b.call(printf, "hello from b!\n"); 00017 00018 EventQueue c; 00019 c.call(printf, "hello from c!\n"); 00020 00021 // Chain c and b onto a's event queue. Both c and b will be dispatched 00022 // in the context of a's dispatch function. 00023 c.chain(&a); 00024 b.chain(&a); 00025 00026 // Dispatching a will in turn dispatch b and c, printing hello from 00027 // all three queues 00028 a.dispatch(); 00029 }
Generated on Wed Jul 20 2022 04:34:16 by
1.7.2