PMU flash issue on Horus

This commit is contained in:
Bertrand Songis
2019-11-08 20:00:31 +01:00
parent 356a39e010
commit 5daee63922
2 changed files with 12 additions and 1 deletions
@@ -228,8 +228,14 @@ void telemetryPortSetDirectionOutput()
TELEMETRY_USART->CR1 &= ~USART_CR1_RE; // turn off receiver
}
void sportWaitTransmissionComplete()
{
while (!(TELEMETRY_USART->SR & USART_SR_TC));
}
void telemetryPortSetDirectionInput()
{
sportWaitTransmissionComplete();
TELEMETRY_DIR_GPIO->BSRRH = TELEMETRY_DIR_GPIO_PIN; // output disable
TELEMETRY_USART->CR1 |= USART_CR1_RE; // turn on receiver
}