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.
Revision 0:fca134a32b61, committed 2017-09-07
- Comitter:
- sarahmarshy
- Date:
- Thu Sep 07 16:01:39 2017 +0000
- Commit message:
- Initial commit;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.gitignore Thu Sep 07 16:01:39 2017 +0000 @@ -0,0 +1,4 @@ +.build +.mbed +projectfiles +*.py*
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Sep 07 16:01:39 2017 +0000
@@ -0,0 +1,29 @@
+#include "mbed_events.h"
+#include <stdio.h>
+
+/**
+Event queues easily align with module boundaries, where internal state can be
+implicitly synchronized through event dispatch. Multiple modules can use
+independent event queues, but still be composed through the EventQueue::chain function.
+**/
+
+int main() {
+ // Create some event queues with pending events
+ EventQueue a;
+ a.call(printf, "hello from a!\n");
+
+ EventQueue b;
+ b.call(printf, "hello from b!\n");
+
+ EventQueue c;
+ c.call(printf, "hello from c!\n");
+
+ // Chain c and b onto a's event queue. Both c and b will be dispatched
+ // in the context of a's dispatch function.
+ c.chain(&a);
+ b.chain(&a);
+
+ // Dispatching a will in turn dispatch b and c, printing hello from
+ // all three queues
+ a.dispatch();
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Thu Sep 07 16:01:39 2017 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#98ba8acb83cfc65f30a8a0771a27c71443ab093a