Bsongis/power control chip (#6445)

FRSK files support added
This commit is contained in:
Bertrand Songis
2019-05-27 12:23:34 +02:00
committed by GitHub
parent 2eb88cb909
commit 8edf77286d
26 changed files with 438 additions and 51 deletions
+1 -1
View File
@@ -157,7 +157,7 @@ add_definitions(-DBLUETOOTH)
set(SRC
${SRC}
bluetooth.cpp
io/frsky_device_firmware_update.cpp
io/frsky_firmware_update.cpp
)
set(STM32LIB_SRC
+2
View File
@@ -595,7 +595,9 @@ int32_t getVolume(void);
// Telemetry driver
#define TELEMETRY_FIFO_SIZE 512
void telemetryPortInit(uint32_t baudrate, uint8_t mode);
void telemetryPortSetDirectionInput(void);
void telemetryPortSetDirectionOutput(void);
void sportSendByte(uint8_t byte);
void sportSendBuffer(const uint8_t * buffer, uint32_t count);
uint8_t telemetryGetByte(uint8_t * byte);
extern uint32_t telemetryErrors;
@@ -138,6 +138,12 @@ void telemetryPortSetDirectionInput()
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();