diff --git a/comms.c b/comms.c index aa80cb1..33e3f80 100644 --- a/comms.c +++ b/comms.c @@ -92,10 +92,11 @@ void input_callback() static unsigned char ct0, ct1, rpt; unsigned char i; -#ifdef KEYS_INPUT_PULLUP // key changed ? -i = key_state ^ ~KEYS_READ_PINS; // for internal pullup the reading is inverted + // key changed ? +#ifdef KEYS_INPUT_PULLUP + i = key_state ^ ~KEYS_READ_PINS; // HW V2.0 for internal pullup the reading is inverted #else -i = key_state ^ KEYS_READ_PINS; + i = key_state ^ KEYS_READ_PINS; // HW V1.0 normal read #endif ct0 = ~( ct0 & i ); // reset or count ct0 diff --git a/config.h b/config.h index 898cca7..96c4f65 100644 --- a/config.h +++ b/config.h @@ -60,7 +60,8 @@ #define CONTROL_SET_BUS0() CONTROL_PORT &= ~(_BV(CONTROL_PIN0) | _BV(CONTROL_PIN1)) #define CONTROL_SET_BUS1() { CONTROL_PORT &= ~_BV(CONTROL_PIN1); CONTROL_PORT |= _BV(CONTROL_PIN0); } -//#define KEYS_INPUT_PULLUP // uncomment this line if you are using HW2.0 + // uncomment this line if you are using HW2.0 +//#define KEYS_INPUT_PULLUP #define KEYS_READ_PORT PORTC #define KEYS_READ_DDR DDRC #define KEYS_READ_PINS PINC diff --git a/tapuino.c b/tapuino.c index a87ba1d..af579dd 100644 --- a/tapuino.c +++ b/tapuino.c @@ -320,7 +320,10 @@ int play_file(FILINFO* pfile_info) // end of load UI indicator lcd_busy_spinner(); - + + // prevent leakage of g_cur_command, the standard mechanism is to use get_cur_command() which would clear the global + g_cur_command = COMMAND_IDLE; + return 1; }