diff --git a/src/x9d/hal.h b/src/x9d/hal.h index b2d3b8b1d..21e95d101 100644 --- a/src/x9d/hal.h +++ b/src/x9d/hal.h @@ -64,10 +64,10 @@ #endif #if defined(REV3) - #define GPIO_PIN_SW_A_L GPIOB->IDR - #define GPIO_PIN_SW_A_H GPIOE->IDR - #define PIN_SW_A_L GPIO_Pin_7 //PB.07 - #define PIN_SW_A_H GPIO_Pin_2 //PE.02 + #define GPIO_PIN_SW_A_H (~GPIOB->IDR) + #define GPIO_PIN_SW_A_L (~GPIOE->IDR) + #define PIN_SW_A_H GPIO_Pin_7 //PB.07 + #define PIN_SW_A_L GPIO_Pin_2 //PE.02 #else #define GPIO_PIN_SW_A_H GPIOB->IDR #define GPIO_PIN_SW_A_L GPIOE->IDR diff --git a/src/x9d/keys_driver.cpp b/src/x9d/keys_driver.cpp index d2b979c60..ef4d0a8e1 100644 --- a/src/x9d/keys_driver.cpp +++ b/src/x9d/keys_driver.cpp @@ -129,7 +129,11 @@ bool switchState(EnumKeys enuk) xxx = (GPIO_PIN_SW_A_H & PIN_SW_A_H) && (~GPIO_PIN_SW_A_L & PIN_SW_A_L); break; case SW_SA1: +#if defined(REV3) + xxx = (~GPIO_PIN_SW_A_H & PIN_SW_A_H) && (~GPIO_PIN_SW_A_L & PIN_SW_A_L); +#else xxx = (GPIO_PIN_SW_A_H & PIN_SW_A_H) && (GPIO_PIN_SW_A_L & PIN_SW_A_L); +#endif break; case SW_SA2: xxx = (~GPIO_PIN_SW_A_H & PIN_SW_A_H) && (GPIO_PIN_SW_A_L & PIN_SW_A_L);