@@ -83,12 +83,24 @@ 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_INPUT();
|
||||
TELEMETRY_USART->CR1 |= USART_CR1_RE; // turn on receiver
|
||||
}
|
||||
|
||||
void sportSendByte(uint8_t byte)
|
||||
{
|
||||
while (!(TELEMETRY_USART->SR & USART_SR_TXE));
|
||||
USART_SendData(TELEMETRY_USART, byte);
|
||||
}
|
||||
|
||||
void sportSendBuffer(const uint8_t * buffer, uint32_t count)
|
||||
{
|
||||
telemetryPortSetDirectionOutput();
|
||||
|
||||
Reference in New Issue
Block a user