kjj
Dependencies: mbed-rtos mbed Xbus
Fork of MTi-1_example by
Revision 34:3d7a6519a256, committed 2015-05-21
- Comitter:
- Alex Young
- Date:
- Thu May 21 12:19:50 2015 +0200
- Parent:
- 33:542e4b568631
- Child:
- 35:7e519b88c610
- Commit message:
- Split out sending message from a full transaction.
The wakeup ack message will not have a response from the MT.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu May 21 12:19:08 2015 +0200
+++ b/main.cpp Thu May 21 12:19:50 2015 +0200
@@ -33,7 +33,7 @@
}
}
-XbusMessage const* doTransaction(XbusMessage* m)
+static void sendMessage(XbusMessage const* m)
{
uint8_t buf[64];
size_t rawLength = XbusMessage_format(buf, m);
@@ -41,6 +41,11 @@
{
mt.putc(buf[i]);
}
+}
+
+static XbusMessage const* doTransaction(XbusMessage const* m)
+{
+ sendMessage(m);
osEvent ev = g_responseQueue.get(500);
return ev.status == osEventMessage ? (XbusMessage*)ev.value.p : NULL;
