From 148d8a726fde7ac53a9ec69dafbe47de260a9e91 Mon Sep 17 00:00:00 2001 From: bsongis Date: Sun, 6 Jan 2013 22:25:10 +0000 Subject: [PATCH] [X9D] Mixer now runs --- src/open9x.cpp | 5 +++++ src/x9d/keys_driver.cpp | 18 +++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/open9x.cpp b/src/open9x.cpp index 836048d9e..076d441a1 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -3430,6 +3430,11 @@ inline void open9xInit(OPEN9X_INIT_ARGS) // TODO startPulses should be started after the first doMixerCalculations() #endif +#if defined(PCBX9D) + // TODO remove this line, it only allows the Mixer to run (until pulses are there!) + s_current_protocol = PROTO_PPM; +#endif + startPulses(); wdt_enable(WDTO_500MS); diff --git a/src/x9d/keys_driver.cpp b/src/x9d/keys_driver.cpp index 1a504a031..0b7ea21d8 100644 --- a/src/x9d/keys_driver.cpp +++ b/src/x9d/keys_driver.cpp @@ -73,16 +73,16 @@ uint32_t readTrims() if (c & PIN_TRIM2_UP) result |= 0x04; if (c & PIN_TRIM2_DN) - result |= 0x03; + result |= 0x08; if (e & PIN_TRIM3_UP) - result |= 0x06; + result |= 0x10; if (e & PIN_TRIM3_DN) - result |= 0x05; + result |= 0x20; if (e & PIN_TRIM4_UP) - result |= 0x08; + result |= 0x40; if (e & PIN_TRIM4_DN) - result |= 0x07; + result |= 0x80; return result; } @@ -104,12 +104,12 @@ void readKeysAndTrims() ++enuk; } -/* in = readTrims(); + in = readTrims(); - for (i = 1; i < 256; i <<= 1) { - keys[enuk].input(in & i, (EnumKeys) enuk); + /* for (i = 1; i < 256; i <<= 1) { + keys[enuk].input(in & i, (EnumKeys)enuk); ++enuk; - }*/ + } */ } uint32_t keyState(EnumKeys enuk)