From ff609188cb7a7e64d140a688aa25501ae45d8a8a Mon Sep 17 00:00:00 2001 From: bsongis Date: Sun, 10 Mar 2013 19:12:19 +0000 Subject: [PATCH] [X9D] REV3 switches assignation (regression) --- src/x9d/hal.h | 16 ++++++++-------- src/x9d/keys_driver.cpp | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/x9d/hal.h b/src/x9d/hal.h index 21e95d101..1df5a9792 100644 --- a/src/x9d/hal.h +++ b/src/x9d/hal.h @@ -76,10 +76,10 @@ #endif #if defined(REV3) - #define GPIO_PIN_SW_G_L GPIOA->IDR - #define GPIO_PIN_SW_G_H GPIOB->IDR - #define PIN_SW_G_L GPIO_Pin_5 //PA.05 - #define PIN_SW_G_H GPIO_Pin_0 //PB.00 + #define GPIO_PIN_SW_G_H GPIOA->IDR + #define GPIO_PIN_SW_G_L GPIOB->IDR + #define PIN_SW_G_H GPIO_Pin_5 //PA.05 + #define PIN_SW_G_L GPIO_Pin_0 //PB.00 #else #define GPIO_PIN_SW_G_H GPIOE->IDR #define GPIO_PIN_SW_G_L GPIOE->IDR @@ -88,10 +88,10 @@ #endif #if defined(REV3) - #define GPIO_PIN_SW_C_L GPIOB->IDR - #define GPIO_PIN_SW_C_H GPIOE->IDR - #define PIN_SW_C_L GPIO_Pin_1 //PB.01 - #define PIN_SW_C_H GPIO_Pin_7 //PE.07 + #define GPIO_PIN_SW_C_H GPIOB->IDR + #define GPIO_PIN_SW_C_L GPIOE->IDR + #define PIN_SW_C_H GPIO_Pin_1 //PB.01 + #define PIN_SW_C_L GPIO_Pin_7 //PE.07 #else #define GPIO_PIN_SW_C_H GPIOE->IDR #define GPIO_PIN_SW_C_L GPIOA->IDR diff --git a/src/x9d/keys_driver.cpp b/src/x9d/keys_driver.cpp index a36286f47..4cdc45581 100644 --- a/src/x9d/keys_driver.cpp +++ b/src/x9d/keys_driver.cpp @@ -198,7 +198,11 @@ bool switchState(EnumKeys enuk) xxx = (GPIO_PIN_SW_G_H & PIN_SW_G_H) && (~GPIO_PIN_SW_G_L & PIN_SW_G_L); break; case SW_SG1: +#if defined(REV3) + xxx = (~GPIO_PIN_SW_G_H & PIN_SW_G_H) && (~GPIO_PIN_SW_G_L & PIN_SW_G_L); +#else xxx = (GPIO_PIN_SW_G_H & PIN_SW_G_H) && (GPIO_PIN_SW_G_L & PIN_SW_G_L); +#endif break; case SW_SG2: xxx = (~GPIO_PIN_SW_G_H & PIN_SW_G_H) && (GPIO_PIN_SW_G_L & PIN_SW_G_L);