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.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
src/OutputTask/OutputTask.cpp@56:225786c56315, 2016-09-14 (annotated)
- Committer:
- jmarkel44
- Date:
- Wed Sep 14 12:56:00 2016 +0000
- Revision:
- 56:225786c56315
- Parent:
- 51:66b820f203a5
- Child:
- 63:0ded43237b22
messaging between the control task and the output task;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmarkel44 | 48:1c7861d80d16 | 1 | #include "global.h" |
jmarkel44 | 48:1c7861d80d16 | 2 | |
jmarkel44 | 48:1c7861d80d16 | 3 | void OutputTask(void const *args) |
jmarkel44 | 48:1c7861d80d16 | 4 | { |
jmarkel44 | 51:66b820f203a5 | 5 | UNUSED(args); |
jmarkel44 | 51:66b820f203a5 | 6 | |
jmarkel44 | 48:1c7861d80d16 | 7 | while (true) { |
jmarkel44 | 51:66b820f203a5 | 8 | // wait for an event |
jmarkel44 | 56:225786c56315 | 9 | osEvent evt = OutputMasterMailBox.get(); |
jmarkel44 | 51:66b820f203a5 | 10 | if (evt.status == osEventMail) { |
jmarkel44 | 51:66b820f203a5 | 11 | OutputControlReq_t *msg = (OutputControlReq_t*) evt.value.p; |
jmarkel44 | 56:225786c56315 | 12 | printf("\r%s received message from someone...\n", __func__); |
jmarkel44 | 56:225786c56315 | 13 | printf("\rmsg->relay = %s\n", msg->relay.c_str()); |
jmarkel44 | 56:225786c56315 | 14 | printf("\rmsg->state = %s\n", msg->state == ON ? "ON" : "OFF"); |
jmarkel44 | 56:225786c56315 | 15 | printf("\rmsg->priority = %u\n", msg->priority); |
jmarkel44 | 56:225786c56315 | 16 | |
jmarkel44 | 56:225786c56315 | 17 | // free the message |
jmarkel44 | 56:225786c56315 | 18 | OutputMasterMailBox.free(msg); |
jmarkel44 | 51:66b820f203a5 | 19 | } |
jmarkel44 | 48:1c7861d80d16 | 20 | } |
jmarkel44 | 48:1c7861d80d16 | 21 | } |