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