From d8467af191970b271cdfaa22f8ecd0cd72f948e5 Mon Sep 17 00:00:00 2001 From: bsongis Date: Sun, 10 Mar 2013 17:54:42 +0000 Subject: [PATCH] [X9D] REV3 switches assignation (regression) --- src/x9d/hal.h | 8 ++++---- src/x9d/keys_driver.cpp | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) 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);