[X9D] Switches now OK on both HW and simu

This commit is contained in:
bernet.andre@gmail.com
2013-01-07 08:42:12 +00:00
parent 5e940e56f4
commit 97595efa83
6 changed files with 24 additions and 17 deletions
+3 -1
View File
@@ -48,5 +48,7 @@ void delaysInit(void) {
void delay_01us(uint16_t nb){
TIM13->CNT = 0;
while(TIM13->CNT < nb);
TIM13->EGR = 1;
while(((uint16_t)TIM13->CNT) < nb);
TIM13->EGR = 0;
}
+1 -1
View File
@@ -12,7 +12,7 @@
#include "../open9x.h"
#define I2C_delay() delay_01us(15);
#define I2C_delay() delay_01us(30);
/**
* @brief Configure the used I/O ports pin
+3 -3
View File
@@ -124,13 +124,13 @@ uint32_t keyState(EnumKeys enuk)
switch ((uint8_t) enuk) {
case SW_SA0:
xxx = (~b & PIN_SW_A_H) && (b & PIN_SW_A_L);
xxx = (~b & PIN_SW_A_H) && (e & PIN_SW_A_L);
break;
case SW_SA1:
xxx = (b & PIN_SW_A_H) && (b & PIN_SW_A_L);
xxx = (b & PIN_SW_A_H) && (e & PIN_SW_A_L);
break;
case SW_SA2:
xxx = (b & PIN_SW_A_H) && (~b & PIN_SW_A_L);
xxx = (b & PIN_SW_A_H) && (~e & PIN_SW_A_L);
break;
case SW_SB0: