diff --git a/src/eeprom_rlc.cpp b/src/eeprom_rlc.cpp index 31941053f..8a3b5b62b 100644 --- a/src/eeprom_rlc.cpp +++ b/src/eeprom_rlc.cpp @@ -958,10 +958,6 @@ void eeLoadModel(uint8_t id) resumeMixerCalculations(); // TODO pulses should be started after mixer calculations ... -#if defined(PCBTARANIS) - startPulses(); -#endif - #if defined(FRSKY) frskySendAlarms(); #endif diff --git a/src/pulses_arm.cpp b/src/pulses_arm.cpp index 302496c4e..2f254db7e 100644 --- a/src/pulses_arm.cpp +++ b/src/pulses_arm.cpp @@ -294,9 +294,9 @@ void setupPulsesPXX(unsigned int port) putPcmByte(0, port); /* PPM */ - static uint32_t pass = 0; + static uint32_t pass[NUM_MODULES] = {0}; uint32_t sendUpperChannels = 0; - if (pass++ & 0x01) { + if (pass[port]++ & 0x01) { sendUpperChannels = g_model.moduleData[port].channelsCount; } for (uint32_t i=0; i<8; i++) { @@ -320,9 +320,9 @@ void setupPulsesPXX(unsigned int port) } else { if (i < sendUpperChannels) - chan = limit(2048, PPM_CH_CENTER(8+g_model.moduleData[0].channelsStart+i) - PPM_CENTER + (channelOutputs[8+g_model.moduleData[0].channelsStart+i] * 512 / 682) + 3072, 4095); + chan = limit(2048, PPM_CH_CENTER(8+g_model.moduleData[port].channelsStart+i) - PPM_CENTER + (channelOutputs[8+g_model.moduleData[port].channelsStart+i] * 512 / 682) + 3072, 4095); else - chan = limit(0, PPM_CH_CENTER(g_model.moduleData[0].channelsStart+i) - PPM_CENTER + (channelOutputs[g_model.moduleData[0].channelsStart+i] * 512 / 682) + 1024, 2047); + chan = limit(0, PPM_CH_CENTER(g_model.moduleData[port].channelsStart+i) - PPM_CENTER + (channelOutputs[g_model.moduleData[port].channelsStart+i] * 512 / 682) + 1024, 2047); } if (i & 1) { diff --git a/src/pulses_arm.h b/src/pulses_arm.h index b8a1c8089..aa534a04b 100644 --- a/src/pulses_arm.h +++ b/src/pulses_arm.h @@ -58,7 +58,12 @@ inline void startPulses() inline bool pulsesStarted() { return s_current_protocol[0] != 255; } inline void pausePulses() { s_pulses_paused = true; } -inline void resumePulses() { s_pulses_paused = false; } +inline void resumePulses() { + s_pulses_paused = false; +#if defined(PCBTARANIS) + startPulses(); //TODO delete +#endif + } #define SEND_FAILSAFE_NOW(idx) failsafeCounter[idx] = 1 diff --git a/src/taranis/adc_driver.cpp b/src/taranis/adc_driver.cpp index 5e23dc5c3..c418bd644 100644 --- a/src/taranis/adc_driver.cpp +++ b/src/taranis/adc_driver.cpp @@ -60,7 +60,7 @@ volatile uint16_t Analog_values[NUMBER_ANALOG]; #if !defined(REV3) -const char ana_direction[NUMBER_ANALOG] = {0,1,1,1, 1,1,1,0, 0}; +const char ana_direction[NUMBER_ANALOG] = {0,1,0,1, 1,1,1,0, 0}; #endif void adcInit() diff --git a/src/taranis/board_taranis.cpp b/src/taranis/board_taranis.cpp index f44423529..0d87101da 100644 --- a/src/taranis/board_taranis.cpp +++ b/src/taranis/board_taranis.cpp @@ -210,7 +210,8 @@ void boardInit() #if defined(DEBUG) uartInit(DEBUG_UART_BAUDRATE); #endif - init_trainer_capture(); init5msTimer(); + init_trainer_capture(); + init5msTimer(); __enable_irq(); eepromInit(); sportInit();