1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-17 13:25:20 +03:00

[Taranis] Overrun errors on S.PORT are now counted and it's possible to display the errors count in the CLI

This commit is contained in:
Bertrand Songis 2016-03-19 12:06:43 +01:00
parent f622d7cf6d
commit 4443ab22ee
3 changed files with 9 additions and 2 deletions

View file

@ -498,11 +498,13 @@ int cliDebugVars(const char ** argv)
#if defined(PCBHORUS)
extern uint32_t ioMutexReq, ioMutexRel;
extern uint32_t sdReadRetries;
serialPrint("ioMutexReq=%d", ioMutexReq);
serialPrint("ioMutexRel=%d", ioMutexRel);
serialPrint("sdReadRetries=%d", sdReadRetries);
#elif defined(PCBTARANIS)
serialPrint("telemetryErrors=%d", telemetryErrors);
#endif
return 0;
}

View file

@ -325,6 +325,7 @@ void telemetryPortInit(uint32_t baudrate);
void telemetryPortSetDirectionOutput(void);
void sportSendBuffer(uint8_t * buffer, uint32_t count);
int telemetryGetByte(uint8_t * byte);
extern uint32_t telemetryErrors;
// Audio driver
void audioInit(void) ;

View file

@ -21,6 +21,7 @@
#include "opentx.h"
Fifo<uint8_t, 32> telemetryFifo;
uint32_t telemetryErrors = 0;
void telemetryPortInit(uint32_t baudrate)
{
@ -125,7 +126,10 @@ extern "C" void TELEMETRY_USART_IRQHandler(void)
uint32_t status = TELEMETRY_USART->SR;
while (status & (USART_FLAG_RXNE | USART_FLAG_ERRORS)) {
uint8_t data = TELEMETRY_USART->DR;
if (!(status & USART_FLAG_ERRORS)) {
if (status & USART_FLAG_ERRORS) {
telemetryErrors++;
}
else {
telemetryFifo.push(data);
}
status = TELEMETRY_USART->SR;