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: PinDetect USBDevice_STM32F103 mbed-STM32F103C8T6
Diff: main.cpp
- Revision:
- 12:d9ccbfd2cc8c
- Parent:
- 11:ff22140b5119
- Child:
- 13:f9eb1f79cd0a
diff -r ff22140b5119 -r d9ccbfd2cc8c main.cpp
--- a/main.cpp Fri Aug 04 07:23:38 2017 +0200
+++ b/main.cpp Fri Aug 04 07:33:32 2017 +0200
@@ -45,15 +45,15 @@
if (msg.data[1] == 0xF0 && msg.data[2] == 0x7D && msg.data[11] == 0xF7) {
sw = msg.data[3];
if (sw < NUM_SWITCHES) {
- switches[sw].type = msg.data[4];
- switches[sw].channel = msg.data[5];
- switches[sw].data1 = msg.data[6];
+ switches[sw].type = msg.data[4] & 0xF;
+ switches[sw].channel = msg.data[5] & 0xF;
+ switches[sw].data1 = msg.data[6] & 0x7F;
if (msg.data[7] > 0)
- switches[sw].on_value = msg.data[8];
+ switches[sw].on_value = msg.data[8] & 0x7F;
else
switches[sw].on_value = -1;
if (msg.data[9] > 0)
- switches[sw].off_value = msg.data[10];
+ switches[sw].off_value = msg.data[10] & 0x7F;
else
switches[sw].off_value = -1;
handlers[sw]->setConfig(switches[sw]);