From 2519df3b59537ccd6b12da1abe3a627c3e878fe6 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sat, 20 Feb 2016 19:40:02 +0100 Subject: [PATCH] [Horus] Cosmetics --- radio/src/targets/horus/telemetry_driver.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/horus/telemetry_driver.cpp b/radio/src/targets/horus/telemetry_driver.cpp index 57cf1f861..db6a2420d 100644 --- a/radio/src/targets/horus/telemetry_driver.cpp +++ b/radio/src/targets/horus/telemetry_driver.cpp @@ -75,6 +75,12 @@ void telemetryPortSetDirectionOutput() TELEMETRY_USART->CR1 &= ~USART_CR1_RE; // turn off receiver } +void telemetryPortSetDirectionInput() +{ + TELEMETRY_GPIO_DIR->BSRRH = TELEMETRY_DIR_GPIO_PIN; // output disable + TELEMETRY_USART->CR1 |= USART_CR1_RE; // turn on receiver +} + void sportSendBuffer(uint8_t *buffer, uint32_t count) { sportTxBuffer.ptr = buffer ; @@ -105,8 +111,7 @@ extern "C" void TELEMETRY_USART_IRQHandler() if ((status & USART_SR_TC) && (TELEMETRY_USART->CR1 & USART_CR1_TCIE)) { TELEMETRY_USART->CR1 &= ~USART_CR1_TCIE ; // stop Complete interrupt - TELEMETRY_GPIO_DIR->BSRRH = TELEMETRY_DIR_GPIO_PIN ; // output disable - TELEMETRY_USART->CR1 |= USART_CR1_RE ; + telemetryPortSetDirectionInput(); while (status & (USART_FLAG_RXNE)) { status = TELEMETRY_USART->DR; status = TELEMETRY_USART->SR ;