Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

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?

UserRevisionLine numberNew 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 }