[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:
+3
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) ;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user