1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 09:45:21 +03:00

[X9D] Serial debug now uses a FIFO, RTC fixed

This commit is contained in:
bernet.andre@gmail.com 2013-02-24 15:48:03 +00:00
parent 5def4849fe
commit 98100708d6
8 changed files with 54 additions and 41 deletions

View file

@ -40,7 +40,8 @@
#if !defined(SIMU)
Fifo32 debugFifo;
Fifo512 debugRxFifo;
Fifo512 debugTxFifo;
// Outputs a string to the UART
void debugPuts(const char *format, ...)
@ -54,7 +55,7 @@ void debugPuts(const char *format, ...)
const char *t = tmp;
while (*t) {
debugPutc(*t++);
debugTxFifo.push(*t++);
}
}
@ -78,10 +79,17 @@ void debugTask(void* pdata)
uint8_t rxchar ;
for (;;) {
while (!debugFifo.pop(rxchar))
while (!debugRxFifo.pop(rxchar))
CoTickDelay(5); // 10ms
}
}
void debugTx(void)
{
uint8_t txchar;
if(debugTxFifo.pop(txchar))
debugPutc(txchar);
}
#endif