|
|
@ -68,12 +68,15 @@ const uint8_t pinBtnChOn2 = 12;
|
|
|
|
*******************************************************************************/
|
|
|
|
*******************************************************************************/
|
|
|
|
const uint8_t pinRelay1 = 13;
|
|
|
|
const uint8_t pinRelay1 = 13;
|
|
|
|
const uint8_t pinRelay2 = A7;
|
|
|
|
const uint8_t pinRelay2 = A7;
|
|
|
|
TimedPin RelayMute(pinRelay2);
|
|
|
|
//TimedPin RelayMute(pinRelay2);
|
|
|
|
|
|
|
|
TimedPin RelayMute(LED_BUILTIN);
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************//**
|
|
|
|
/***************************************************************************//**
|
|
|
|
* @brief LED
|
|
|
|
* @brief LED
|
|
|
|
*******************************************************************************/
|
|
|
|
*******************************************************************************/
|
|
|
|
TimedPin LedBoard(LED_BUILTIN);
|
|
|
|
//TimedPin LedBoard(LED_BUILTIN);
|
|
|
|
|
|
|
|
TimedPin LedBoard(pinRelay2);
|
|
|
|
|
|
|
|
|
|
|
|
TimedPin LedChOn1(pinLedChOn1);
|
|
|
|
TimedPin LedChOn1(pinLedChOn1);
|
|
|
|
TimedPin LedChOn2(pinLedChOn2);
|
|
|
|
TimedPin LedChOn2(pinLedChOn2);
|
|
|
|
TimedPin LedInc1(pinLedInc1);
|
|
|
|
TimedPin LedInc1(pinLedInc1);
|
|
|
@ -86,8 +89,8 @@ TimedPin LedDec2(pinLedDec2);
|
|
|
|
bool MidiCfgTxOnly; /// duplex or only tx configuration (without MIDI rx line)
|
|
|
|
bool MidiCfgTxOnly; /// duplex or only tx configuration (without MIDI rx line)
|
|
|
|
|
|
|
|
|
|
|
|
MixerMuteState AirMutes[2] = {
|
|
|
|
MixerMuteState AirMutes[2] = {
|
|
|
|
MixerMuteState(22, &LedChOn1, BTN_CH_ON1, EV_UI_RX_MUTE_CH1_ON, EV_UI_RX_MUTE_CH1_OFF),
|
|
|
|
MixerMuteState(22, &LedChOn1, &RelayMute, BTN_CH_ON1, EV_UI_RX_MUTE_CH1_ON, EV_UI_RX_MUTE_CH1_OFF),
|
|
|
|
MixerMuteStateRly(23, &LedChOn2, &RelayMute, BTN_CH_ON2, EV_UI_RX_MUTE_CH2_ON, EV_UI_RX_MUTE_CH2_OFF)
|
|
|
|
MixerMuteState(23, &LedChOn2, BTN_CH_ON2, EV_UI_RX_MUTE_CH2_ON, EV_UI_RX_MUTE_CH2_OFF)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
MixerFaderState AirFaders[2] = {
|
|
|
|
MixerFaderState AirFaders[2] = {
|
|
|
@ -96,9 +99,6 @@ MixerFaderState AirFaders[2] = {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(ARDUINO_SAM_DUE) || defined(USBCON) || defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MKL26Z64__)
|
|
|
|
|
|
|
|
HardwareSerial& Serial1; // Unused code, workaround for Intellisense bug
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/***************************************************************************//**
|
|
|
|
/***************************************************************************//**
|
|
|
|
* @brief MIDI instance (serial port)
|
|
|
|
* @brief MIDI instance (serial port)
|
|
|
|
*******************************************************************************/
|
|
|
|
*******************************************************************************/
|
|
|
@ -111,6 +111,7 @@ void MidiCCHandler(byte channel, byte ctrl_no, byte val) {
|
|
|
|
MixerFaderState& fader = AirFaders[i];
|
|
|
|
MixerFaderState& fader = AirFaders[i];
|
|
|
|
if (ctrl_no == fader.MidiCtrlNr) {
|
|
|
|
if (ctrl_no == fader.MidiCtrlNr) {
|
|
|
|
fader.VolumeReceived(val);
|
|
|
|
fader.VolumeReceived(val);
|
|
|
|
|
|
|
|
UI_EventProc(EV_UI_RX_MIDI);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -172,6 +173,12 @@ void setup() {
|
|
|
|
UI_Init(); // Start user interface (main state machine)
|
|
|
|
UI_Init(); // Start user interface (main state machine)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static uint8_t BtnPrev = 0x00;
|
|
|
|
|
|
|
|
uint8_t ButtonGetVal() { return BtnPrev; }
|
|
|
|
|
|
|
|
bool ButtonCheck(uint8_t btn) {
|
|
|
|
|
|
|
|
return (BtnPrev & (1 << btn)) ? true : false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************//**
|
|
|
|
/***************************************************************************//**
|
|
|
|
* @brief Main loop
|
|
|
|
* @brief Main loop
|
|
|
|
*******************************************************************************/
|
|
|
|
*******************************************************************************/
|
|
|
@ -181,7 +188,6 @@ void loop() {
|
|
|
|
uint32_t t = millis();
|
|
|
|
uint32_t t = millis();
|
|
|
|
// execute every 10ms *******************************************************
|
|
|
|
// execute every 10ms *******************************************************
|
|
|
|
if (Tmr10ms.Check(t)) {
|
|
|
|
if (Tmr10ms.Check(t)) {
|
|
|
|
static uint8_t BtnPrev = 0x00;
|
|
|
|
|
|
|
|
static uint8_t BtnNew = 0;
|
|
|
|
static uint8_t BtnNew = 0;
|
|
|
|
static uint8_t BtnRel = 0;
|
|
|
|
static uint8_t BtnRel = 0;
|
|
|
|
uint8_t btn = (digitalRead(pinBtnInc1) ? 0: (1 << BTN_INC1 ))
|
|
|
|
uint8_t btn = (digitalRead(pinBtnInc1) ? 0: (1 << BTN_INC1 ))
|
|
|
|