diff --git a/radio/src/targets/horus/telemetry_driver.cpp b/radio/src/targets/horus/telemetry_driver.cpp index 520898478..be14dd151 100644 --- a/radio/src/targets/horus/telemetry_driver.cpp +++ b/radio/src/targets/horus/telemetry_driver.cpp @@ -78,6 +78,10 @@ void telemetryPortInit(uint32_t baudrate, uint8_t mode) #if defined(PCBX12S) telemetryFifoMode = mode; + + DMA_Cmd(TELEMETRY_DMA_Stream_RX, DISABLE); + USART_DMACmd(TELEMETRY_USART, USART_DMAReq_Rx, DISABLE); + DMA_DeInit(TELEMETRY_DMA_Stream_RX); if (mode & TELEMETRY_SERIAL_WITHOUT_DMA) { USART_Cmd(TELEMETRY_USART, ENABLE); diff --git a/radio/src/targets/sky9x/telemetry_driver.cpp b/radio/src/targets/sky9x/telemetry_driver.cpp index 4446ee37a..e9dc3edaa 100644 --- a/radio/src/targets/sky9x/telemetry_driver.cpp +++ b/radio/src/targets/sky9x/telemetry_driver.cpp @@ -48,7 +48,7 @@ void UART2_Configure(uint32_t baudrate, uint32_t masterClock, int mode) pUsart->US_CR = US_CR_RSTRX | US_CR_RSTTX | US_CR_RXDIS | US_CR_TXDIS; // Configure mode - if (mode == TELEMETRY_SERIAL_8E2) + if (mode & TELEMETRY_SERIAL_8E2) pUsart->US_MR = 0x000020C0 ; else pUsart->US_MR = 0x000008C0 ; // NORMAL, No Parity, 8 bit diff --git a/radio/src/telemetry/telemetry.cpp b/radio/src/telemetry/telemetry.cpp index e6a0aef87..ad7a2992d 100644 --- a/radio/src/telemetry/telemetry.cpp +++ b/radio/src/telemetry/telemetry.cpp @@ -410,20 +410,23 @@ void telemetryReset() #if defined(CPUARM) // we don't reset the telemetry here as we would also reset the consumption after model load -void telemetryInit(uint8_t protocol) { +void telemetryInit(uint8_t protocol) +{ + if (protocol == PROTOCOL_FRSKY_D) { + telemetryPortInit(FRSKY_D_BAUDRATE, TELEMETRY_SERIAL_DEFAULT); + } + #if defined(MULTIMODULE) - if (protocol == PROTOCOL_MULTIMODULE || protocol == PROTOCOL_FLYSKY_IBUS) { + else if (protocol == PROTOCOL_MULTIMODULE || protocol == PROTOCOL_FLYSKY_IBUS) { // The DIY Multi module always speaks 100000 baud regardless of the telemetry protocol in use telemetryPortInit(MULTIMODULE_BAUDRATE, TELEMETRY_SERIAL_8E2); } else if (protocol == PROTOCOL_SPEKTRUM) { // Spektrum's own small race RX (SPM4648) uses 125000 8N1, use the same since there is no real standard telemetryPortInit(125000, TELEMETRY_SERIAL_DEFAULT); - } else -#endif - if (protocol == PROTOCOL_FRSKY_D) { - telemetryPortInit(FRSKY_D_BAUDRATE, TELEMETRY_SERIAL_DEFAULT); } +#endif + #if defined(CROSSFIRE) else if (protocol == PROTOCOL_PULSES_CROSSFIRE) { telemetryPortInit(CROSSFIRE_BAUDRATE, TELEMETRY_SERIAL_DEFAULT); @@ -434,12 +437,14 @@ void telemetryInit(uint8_t protocol) { telemetryPortSetDirectionOutput(); } #endif + #if defined(SERIAL2) else if (protocol == PROTOCOL_FRSKY_D_SECONDARY) { telemetryPortInit(0, TELEMETRY_SERIAL_DEFAULT); serial2TelemetryInit(PROTOCOL_FRSKY_D_SECONDARY); } #endif + else { telemetryPortInit(FRSKY_SPORT_BAUDRATE, TELEMETRY_SERIAL_WITHOUT_DMA); #if defined(LUA)