Hi,
It is not first time I am using Case structure, but having so weird problems that maybe I am just blind to my own mistakes. Never mind the other code the case structure is what is failing.
The problem is that the order on what the cases are affects if they get executed. If I put the case 0xB0: after case 0xF0: it does not get executed. The default does not get executed unless it is the first case.
Please help, can you spot what is the problem.
It is not first time I am using Case structure, but having so weird problems that maybe I am just blind to my own mistakes. Never mind the other code the case structure is what is failing.
The problem is that the order on what the cases are affects if they get executed. If I put the case 0xB0: after case 0xF0: it does not get executed. The default does not get executed unless it is the first case.
Please help, can you spot what is the problem.
Code:
void process_usbMIDI(void) {
uint8_t type, channel, data1, data2, cable;
type = usbMIDI.getType();
channel = usbMIDI.getChannel();
data1 = usbMIDI.getData1();
data2 = usbMIDI.getData2();
cable = usbMIDI.getCable();
switch (type) {
case 0xB0:
USBhostMIDI.send( type, data1, data2, channel, cable );
Serial1.print("1<"); printMIDI(type, channel, data1, data2, cable, usbMIDI.getSysExArray());
break;
case 0xF0:
uint16_t SysExLength = data1 + data2 * 256;
USBhostMIDI.sendSysEx(SysExLength, usbMIDI.getSysExArray(), true);
Serial1.print("2<"); decodeLCXL_SysEx(usbMIDI.getSysExArray(), SysExLength );
break;
default:
Serial1.print("UNKNOWN TYPE");
break;
}
}