Fixes #2360
This commit is contained in:
@@ -128,7 +128,7 @@ void simuInit()
|
|||||||
if ((int)state > 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
|
if ((int)state > 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
|
||||||
break;
|
break;
|
||||||
#define KEY_CASE NEG_CASE
|
#define KEY_CASE NEG_CASE
|
||||||
#define TRIM_CASE KEY_CASE
|
#define TRIM_CASE NEG_CASE
|
||||||
#else
|
#else
|
||||||
#if defined(PCBMEGA2560)
|
#if defined(PCBMEGA2560)
|
||||||
#define SWITCH_CASE POS_CASE
|
#define SWITCH_CASE POS_CASE
|
||||||
|
|||||||
@@ -176,7 +176,6 @@ void calcConsumption();
|
|||||||
// #define JACK_PPM_IN() PIOC->PIO_PER = PIO_PC22
|
// #define JACK_PPM_IN() PIOC->PIO_PER = PIO_PC22
|
||||||
void checkTrainerSettings();
|
void checkTrainerSettings();
|
||||||
|
|
||||||
|
|
||||||
void setSticksGain(uint8_t gains);
|
void setSticksGain(uint8_t gains);
|
||||||
|
|
||||||
// Write Flash driver
|
// Write Flash driver
|
||||||
@@ -186,8 +185,8 @@ void writeFlash(uint32_t * address, uint32_t * buffer);
|
|||||||
// Keys driver
|
// Keys driver
|
||||||
extern uint32_t readKeys();
|
extern uint32_t readKeys();
|
||||||
extern uint32_t readTrims();
|
extern uint32_t readTrims();
|
||||||
#define TRIMS_PRESSED() (readTrims())
|
#define TRIMS_PRESSED() readTrims()
|
||||||
#define KEYS_PRESSED() (readKeys())
|
#define KEYS_PRESSED() readKeys()
|
||||||
|
|
||||||
// Pulses driver
|
// Pulses driver
|
||||||
void init_no_pulses(uint32_t port);
|
void init_no_pulses(uint32_t port);
|
||||||
|
|||||||
@@ -63,9 +63,9 @@ uint32_t readKeys()
|
|||||||
result |= 0x02 << KEY_UP;
|
result |= 0x02 << KEY_UP;
|
||||||
if (x & KEYS_GPIO_PIN_DOWN)
|
if (x & KEYS_GPIO_PIN_DOWN)
|
||||||
result |= 0x02 << KEY_DOWN;
|
result |= 0x02 << KEY_DOWN;
|
||||||
if (KEYS_GPIO_REG_EXIT & KEYS_GPIO_PIN_EXIT)
|
if (~KEYS_GPIO_REG_EXIT & KEYS_GPIO_PIN_EXIT)
|
||||||
result |= 0x02 << KEY_EXIT;
|
result |= 0x02 << KEY_EXIT;
|
||||||
if (KEYS_GPIO_REG_MENU & 0x000000040)
|
if (~KEYS_GPIO_REG_MENU & KEYS_GPIO_PIN_MENU)
|
||||||
result |= 0x02 << KEY_MENU;
|
result |= 0x02 << KEY_MENU;
|
||||||
#else
|
#else
|
||||||
if (x & KEYS_GPIO_PIN_RIGHT)
|
if (x & KEYS_GPIO_PIN_RIGHT)
|
||||||
@@ -78,7 +78,7 @@ uint32_t readKeys()
|
|||||||
result |= 0x02 << KEY_DOWN;
|
result |= 0x02 << KEY_DOWN;
|
||||||
if (x & KEYS_GPIO_PIN_EXIT)
|
if (x & KEYS_GPIO_PIN_EXIT)
|
||||||
result |= 0x02 << KEY_EXIT;
|
result |= 0x02 << KEY_EXIT;
|
||||||
if (KEYS_GPIO_REG_MENU & KEYS_GPIO_PIN_MENU)
|
if (~KEYS_GPIO_REG_MENU & KEYS_GPIO_PIN_MENU)
|
||||||
result |= 0x02 << KEY_MENU;
|
result |= 0x02 << KEY_MENU;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ void readKeysAndTrims()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint8_t enuk = KEY_MENU;
|
uint8_t enuk = KEY_MENU;
|
||||||
uint8_t in = ~readKeys();
|
uint8_t in = readKeys();
|
||||||
for (i = 1; i < 7; i++) {
|
for (i = 1; i < 7; i++) {
|
||||||
keys[enuk].input(in & (1 << i));
|
keys[enuk].input(in & (1 << i));
|
||||||
++enuk;
|
++enuk;
|
||||||
|
|||||||
Reference in New Issue
Block a user