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@63:0ded43237b22, 2016-09-15 (annotated)
- Committer:
- jmarkel44
- Date:
- Thu Sep 15 21:36:05 2016 +0000
- Revision:
- 63:0ded43237b22
- Parent:
- 56:225786c56315
- Child:
- 66:db1425574b58
base work for output
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 | 63:0ded43237b22 | 3 | |
jmarkel44 | 63:0ded43237b22 | 4 | |
jmarkel44 | 48:1c7861d80d16 | 5 | void OutputTask(void const *args) |
jmarkel44 | 48:1c7861d80d16 | 6 | { |
jmarkel44 | 51:66b820f203a5 | 7 | UNUSED(args); |
jmarkel44 | 63:0ded43237b22 | 8 | |
jmarkel44 | 48:1c7861d80d16 | 9 | while (true) { |
jmarkel44 | 51:66b820f203a5 | 10 | // wait for an event |
jmarkel44 | 56:225786c56315 | 11 | osEvent evt = OutputMasterMailBox.get(); |
jmarkel44 | 51:66b820f203a5 | 12 | if (evt.status == osEventMail) { |
jmarkel44 | 63:0ded43237b22 | 13 | OutputControlMsg_t *msg = (OutputControlMsg_t*) evt.value.p; |
jmarkel44 | 56:225786c56315 | 14 | printf("\r%s received message from someone...\n", __func__); |
jmarkel44 | 63:0ded43237b22 | 15 | printf("\rmsg->relay = %s\n", msg->output.c_str()); |
jmarkel44 | 56:225786c56315 | 16 | printf("\rmsg->state = %s\n", msg->state == ON ? "ON" : "OFF"); |
jmarkel44 | 56:225786c56315 | 17 | printf("\rmsg->priority = %u\n", msg->priority); |
jmarkel44 | 63:0ded43237b22 | 18 | |
jmarkel44 | 63:0ded43237b22 | 19 | switch ( msg->action ) { |
jmarkel44 | 63:0ded43237b22 | 20 | case ACTION_NEW: |
jmarkel44 | 63:0ded43237b22 | 21 | // read the file and and create an output entry |
jmarkel44 | 63:0ded43237b22 | 22 | break; |
jmarkel44 | 63:0ded43237b22 | 23 | case ACTION_CONTROL_REQ: |
jmarkel44 | 63:0ded43237b22 | 24 | default: |
jmarkel44 | 63:0ded43237b22 | 25 | break; |
jmarkel44 | 63:0ded43237b22 | 26 | } |
jmarkel44 | 63:0ded43237b22 | 27 | |
jmarkel44 | 56:225786c56315 | 28 | // free the message |
jmarkel44 | 56:225786c56315 | 29 | OutputMasterMailBox.free(msg); |
jmarkel44 | 51:66b820f203a5 | 30 | } |
jmarkel44 | 48:1c7861d80d16 | 31 | } |
jmarkel44 | 48:1c7861d80d16 | 32 | } |