None
None
combo input
combo output
combo led
int flash_cnt = 0;
bool flash_state = false;
const int FLASH_LEN = 0x100;
if (attr_led) {
sysmon_disable_blinker();
palSetPadMode(LED2_PORT, LED2_PIN, PAL_MODE_OUTPUT_PUSHPULL);
}
flash_cnt = 0;
flash_state = false;
if (attr_led) {
if (flash_cnt > 0)
flash_cnt--;
bool fs = flash_cnt > 0;
if (fs != flash_state) {
palWritePad(LED2_PORT, LED2_PIN, fs);
flash_state = fs;
}
}
if (attr_input) {
uint8_t status_type = status & 0xF0;
if ((status_type == MIDI_CONTROL_CHANGE) || (status_type == MIDI_NOTE_OFF) ||
(status_type == MIDI_NOTE_ON) || (status_type == MIDI_POLY_PRESSURE) ||
(status_type == MIDI_PITCH_BEND)) {
MidiSend3((midi_device_t)attr_output, status, data1, data2);
flash_cnt = FLASH_LEN;
} else if ((status_type == MIDI_PROGRAM_CHANGE) ||
(status_type == MIDI_CHANNEL_PRESSURE)) {
MidiSend2((midi_device_t)attr_output, status, data1);
flash_cnt = FLASH_LEN;
} else if ((status == MIDI_TIMING_CLOCK) || (status == MIDI_START) ||
(status == MIDI_CONTINUE) || (status == MIDI_STOP)) {
MidiSend1((midi_device_t)attr_output, status);
}
}