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: midiswitch.cpp
- Revision:
- 12:d9ccbfd2cc8c
- Parent:
- 11:ff22140b5119
--- a/midiswitch.cpp Fri Aug 04 07:23:38 2017 +0200
+++ b/midiswitch.cpp Fri Aug 04 07:33:32 2017 +0200
@@ -29,7 +29,7 @@
bool SwitchHandler::make_message(bool onoff) {
uint8_t value = (onoff ? cfg.on_value : cfg.off_value) & 0x7F;
msg.data[0] = CABLE_NUM | cfg.type;
- msg.data[1] = (cfg.type << 4) | (cfg.channel & 0x0F);
+ msg.data[1] = (cfg.type << 4) | (cfg.channel & 0xF);
msg.data[2] = 0x00;
msg.data[3] = 0x00;
@@ -47,12 +47,12 @@
case 0x8: // Note off
case 0x9: // Note on
msg.data[3] = value;
- msg.data[2] = cfg.data1 & 0x0F;
+ msg.data[2] = cfg.data1 & 0x7F;
break;
case 0xA: // Poly pressure
case 0xB: // Control change
case 0xE: // PitchBend
- msg.data[2] = cfg.data1 & 0x0F;
+ msg.data[2] = cfg.data1 & 0x7F;
msg.data[3] = value;
break;
default: