Telemetry driver stubs (#8196)
This commit is contained in:
@@ -217,12 +217,8 @@ set(FIRMWARE_TARGET_SRC
|
||||
${FIRMWARE_TARGET_SRC}
|
||||
keys_driver.cpp
|
||||
diskio.cpp
|
||||
)
|
||||
|
||||
set(TARGET_SRC
|
||||
${TARGET_SRC}
|
||||
telemetry_driver.cpp
|
||||
)
|
||||
)
|
||||
|
||||
set(FIRMWARE_SRC
|
||||
${FIRMWARE_SRC}
|
||||
|
||||
@@ -42,6 +42,8 @@ char * main_thread_error = nullptr;
|
||||
bool simu_shutdown = false;
|
||||
bool simu_running = false;
|
||||
|
||||
uint32_t telemetryErrors = 0;
|
||||
|
||||
#if defined(STM32)
|
||||
GPIO_TypeDef gpioa, gpiob, gpioc, gpiod, gpioe, gpiof, gpiog, gpioh, gpioi, gpioj;
|
||||
TIM_TypeDef tim1, tim2, tim3, tim4, tim5, tim6, tim7, tim8, tim9, tim10;
|
||||
@@ -441,6 +443,47 @@ void sportUpdatePowerInit()
|
||||
{
|
||||
}
|
||||
|
||||
void telemetryPortSetDirectionInput()
|
||||
{
|
||||
}
|
||||
|
||||
void telemetryPortSetDirectionOutput()
|
||||
{
|
||||
}
|
||||
|
||||
void rxPdcUsart( void (*pChProcess)(uint8_t x) )
|
||||
{
|
||||
}
|
||||
|
||||
void telemetryPortInit(uint32_t baudrate, uint8_t mode)
|
||||
{
|
||||
}
|
||||
|
||||
bool telemetryGetByte(uint8_t * byte)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void telemetryClearFifo()
|
||||
{
|
||||
}
|
||||
|
||||
void telemetryPortInvertedInit(uint32_t baudrate)
|
||||
{
|
||||
}
|
||||
|
||||
void sportSendByte(uint8_t byte)
|
||||
{
|
||||
}
|
||||
|
||||
void sportSendBuffer(const uint8_t * buffer, uint32_t count)
|
||||
{
|
||||
}
|
||||
|
||||
void check_telemetry_exti()
|
||||
{
|
||||
}
|
||||
|
||||
void boardInit()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -122,9 +122,13 @@ set(FIRMWARE_TARGET_SRC
|
||||
MEDSdcard.c
|
||||
)
|
||||
|
||||
set(FIRMWARE_TARGET_SRC
|
||||
${FIRMWARE_TARGET_SRC}
|
||||
telemetry_driver.cpp
|
||||
)
|
||||
|
||||
set(TARGET_SRC
|
||||
${TARGET_SRC}
|
||||
telemetry_driver.cpp
|
||||
adc_driver.cpp
|
||||
pulses_driver.cpp
|
||||
audio_driver.cpp
|
||||
|
||||
@@ -395,13 +395,8 @@ void debugPutc(const char c);
|
||||
|
||||
// Telemetry driver
|
||||
void telemetryPortInit(uint32_t baudrate, uint8_t mode);
|
||||
inline void telemetryPortSetDirectionOutput()
|
||||
{
|
||||
}
|
||||
inline void telemetryPortSetDirectionInput()
|
||||
{
|
||||
}
|
||||
uint32_t telemetryTransmitPending();
|
||||
void telemetryPortSetDirectionOutput();
|
||||
void telemetryPortSetDirectionInput();
|
||||
void telemetryTransmitBuffer(const uint8_t * buffer, uint32_t size);
|
||||
void rxPdcUsart( void (*pChProcess)(uint8_t x) );
|
||||
void sportSendBuffer(const uint8_t * buffer, uint32_t size);
|
||||
|
||||
@@ -93,10 +93,8 @@ void startPdcUsartReceive()
|
||||
{
|
||||
Usart *pUsart = SECOND_USART;
|
||||
TelemetryInBuffer.outPtr = TelemetryInBuffer.fifo ;
|
||||
#ifndef SIMU
|
||||
pUsart->US_RPR = (uint32_t)TelemetryInBuffer.fifo ;
|
||||
pUsart->US_RNPR = (uint32_t)TelemetryInBuffer.fifo ;
|
||||
#endif
|
||||
pUsart->US_RCR = RX_UART_BUFFER_SIZE ;
|
||||
pUsart->US_RNCR = RX_UART_BUFFER_SIZE ;
|
||||
pUsart->US_PTCR = US_PTCR_RXTEN ;
|
||||
@@ -104,7 +102,6 @@ void startPdcUsartReceive()
|
||||
|
||||
void rxPdcUsart( void (*pChProcess)(uint8_t x) )
|
||||
{
|
||||
#if !defined(SIMU)
|
||||
Usart *pUsart = SECOND_USART;
|
||||
uint8_t *ptr ;
|
||||
uint8_t *endPtr ;
|
||||
@@ -132,7 +129,6 @@ void rxPdcUsart( void (*pChProcess)(uint8_t x) )
|
||||
pUsart->US_RNPR = (uint32_t)TelemetryInBuffer.fifo ;
|
||||
pUsart->US_RNCR = RX_UART_BUFFER_SIZE ;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32_t txPdcUsart(const uint8_t * buffer, uint32_t size)
|
||||
@@ -140,9 +136,7 @@ uint32_t txPdcUsart(const uint8_t * buffer, uint32_t size)
|
||||
Usart * pUsart = SECOND_USART;
|
||||
|
||||
if (pUsart->US_TNCR == 0) {
|
||||
#ifndef SIMU
|
||||
pUsart->US_TNPR = (uint32_t)buffer ;
|
||||
#endif
|
||||
pUsart->US_TNCR = size ;
|
||||
pUsart->US_PTCR = US_PTCR_TXTEN ;
|
||||
return 1 ;
|
||||
@@ -150,6 +144,7 @@ uint32_t txPdcUsart(const uint8_t * buffer, uint32_t size)
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
/*
|
||||
uint32_t telemetryTransmitPending()
|
||||
{
|
||||
Usart *pUsart = SECOND_USART;
|
||||
@@ -164,13 +159,20 @@ uint32_t telemetryTransmitPending()
|
||||
|
||||
return x ;
|
||||
}
|
||||
*/
|
||||
|
||||
void telemetryPortSetDirectionOutput()
|
||||
{
|
||||
}
|
||||
|
||||
void telemetryPortSetDirectionInput()
|
||||
{
|
||||
}
|
||||
|
||||
void telemetryPortInit(uint32_t baudrate, uint8_t mode)
|
||||
{
|
||||
#if !defined(SIMU)
|
||||
UART2_Configure(baudrate, Master_frequency, mode);
|
||||
startPdcUsartReceive();
|
||||
#endif
|
||||
}
|
||||
|
||||
void sportSendBuffer(const uint8_t * buffer, uint32_t size)
|
||||
|
||||
Reference in New Issue
Block a user