|
|
@ -25,9 +25,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
#define DEBUG |
|
|
|
#define DEBUG |
|
|
|
|
|
|
|
|
|
|
|
#define STROBE_TM 9 |
|
|
|
#define STROBE_TM 10 |
|
|
|
#define CLOCK_TM 8 |
|
|
|
#define CLOCK_TM 9 |
|
|
|
#define DIO_TM 7 |
|
|
|
#define DIO_TM 8 |
|
|
|
#define MIDI_CH_BIT3 3 |
|
|
|
#define MIDI_CH_BIT3 3 |
|
|
|
#define MIDI_CH_BIT2 4 |
|
|
|
#define MIDI_CH_BIT2 4 |
|
|
|
#define MIDI_CH_BIT1 5 |
|
|
|
#define MIDI_CH_BIT1 5 |
|
|
@ -148,18 +148,22 @@ void SetMidiChannel(uint8_t channel) { |
|
|
|
|
|
|
|
|
|
|
|
uint8_t read_channel_from_eeprom(void) { |
|
|
|
uint8_t read_channel_from_eeprom(void) { |
|
|
|
uint8_t tmp_channel = EEPROM.read(EEPROM_ADDRESS); |
|
|
|
uint8_t tmp_channel = EEPROM.read(EEPROM_ADDRESS); |
|
|
|
|
|
|
|
uint8_t channel; |
|
|
|
|
|
|
|
|
|
|
|
if (tmp_channel & 0xf0 != 0xf0) { |
|
|
|
if (tmp_channel & 0xf0 != 0xf0) { |
|
|
|
actual_channel = 1; |
|
|
|
channel = 1; |
|
|
|
#if defined(DEBUG) |
|
|
|
#if defined(DEBUG) |
|
|
|
Serial.println("Setting channel to 1"); |
|
|
|
Serial.println("Setting channel to 1"); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
actual_channel = 0x0f & tmp_channel; |
|
|
|
channel = 0x0f & tmp_channel; |
|
|
|
#if defined(DEBUG) |
|
|
|
#if defined(DEBUG) |
|
|
|
Serial.print("Reading channel from EEPROM: "); |
|
|
|
Serial.print("Reading channel from EEPROM: "); |
|
|
|
Serial.println(actual_channel, DEC); |
|
|
|
Serial.println(channel, DEC); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return(channel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if defined(DEBUG) |
|
|
|
#if defined(DEBUG) |
|
|
|