[Horus] Cosmetics

This commit is contained in:
Bertrand Songis
2016-02-20 19:40:02 +01:00
parent 6e30373f86
commit 2519df3b59
+7 -2
View File
@@ -75,6 +75,12 @@ void telemetryPortSetDirectionOutput()
TELEMETRY_USART->CR1 &= ~USART_CR1_RE; // turn off receiver 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) void sportSendBuffer(uint8_t *buffer, uint32_t count)
{ {
sportTxBuffer.ptr = buffer ; sportTxBuffer.ptr = buffer ;
@@ -105,8 +111,7 @@ extern "C" void TELEMETRY_USART_IRQHandler()
if ((status & USART_SR_TC) && (TELEMETRY_USART->CR1 & USART_CR1_TCIE)) { if ((status & USART_SR_TC) && (TELEMETRY_USART->CR1 & USART_CR1_TCIE)) {
TELEMETRY_USART->CR1 &= ~USART_CR1_TCIE ; // stop Complete interrupt TELEMETRY_USART->CR1 &= ~USART_CR1_TCIE ; // stop Complete interrupt
TELEMETRY_GPIO_DIR->BSRRH = TELEMETRY_DIR_GPIO_PIN ; // output disable telemetryPortSetDirectionInput();
TELEMETRY_USART->CR1 |= USART_CR1_RE ;
while (status & (USART_FLAG_RXNE)) { while (status & (USART_FLAG_RXNE)) {
status = TELEMETRY_USART->DR; status = TELEMETRY_USART->DR;
status = TELEMETRY_USART->SR ; status = TELEMETRY_USART->SR ;