From 46fc4321e4e09c008c90c07c6d9f585591f1f615 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Sun, 24 Sep 2023 14:50:22 +0200 Subject: [PATCH] Small fixes. --- MIDI-Host-Adapter.ino | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/MIDI-Host-Adapter.ino b/MIDI-Host-Adapter.ino index 5a8497e..d4370d2 100644 --- a/MIDI-Host-Adapter.ino +++ b/MIDI-Host-Adapter.ino @@ -25,9 +25,9 @@ #define DEBUG -#define STROBE_TM 9 -#define CLOCK_TM 8 -#define DIO_TM 7 +#define STROBE_TM 10 +#define CLOCK_TM 9 +#define DIO_TM 8 #define MIDI_CH_BIT3 3 #define MIDI_CH_BIT2 4 #define MIDI_CH_BIT1 5 @@ -148,18 +148,22 @@ void SetMidiChannel(uint8_t channel) { uint8_t read_channel_from_eeprom(void) { uint8_t tmp_channel = EEPROM.read(EEPROM_ADDRESS); + uint8_t channel; + if (tmp_channel & 0xf0 != 0xf0) { - actual_channel = 1; + channel = 1; #if defined(DEBUG) Serial.println("Setting channel to 1"); #endif } else { - actual_channel = 0x0f & tmp_channel; + channel = 0x0f & tmp_channel; #if defined(DEBUG) Serial.print("Reading channel from EEPROM: "); - Serial.println(actual_channel, DEC); + Serial.println(channel, DEC); #endif } + + return(channel); } #if defined(DEBUG)