make debug console stall until host has downloaded

pull/736/head
Kevin Hester 2021-03-08 17:10:48 +08:00
rodzic 781d2f0ad6
commit f8ec072093
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -20,7 +20,7 @@ size_t RedirectablePrint::write(uint8_t c)
{
// Always send the characters to our segger JTAG debugger
#ifdef SEGGER_STDOUT_CH
SEGGER_RTT_PutCharSkip(SEGGER_STDOUT_CH, c);
SEGGER_RTT_PutChar(SEGGER_STDOUT_CH, c);
#endif
dest->write(c);
@ -85,6 +85,8 @@ size_t RedirectablePrint::logDebug(const char *format, ...)
auto thread = concurrency::OSThread::currentThread;
if(thread) {
print("[");
// printf("%p ", thread);
// assert(thread->ThreadName.length());
print(thread->ThreadName);
print("] ");
}

Wyświetl plik

@ -279,7 +279,13 @@ void setup()
concurrency::hasBeenSetup = true;
#ifdef SEGGER_STDOUT_CH
SEGGER_RTT_ConfigUpBuffer(SEGGER_STDOUT_CH, NULL, NULL, 1024, SEGGER_RTT_MODE_NO_BLOCK_TRIM);
auto mode = true ? SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL : SEGGER_RTT_MODE_NO_BLOCK_TRIM;
#ifdef NRF52840_XXAA
auto buflen = 4096; // this board has a fair amount of ram
#else
auto buflen = 256; // this board has a fair amount of ram
#endif
SEGGER_RTT_ConfigUpBuffer(SEGGER_STDOUT_CH, NULL, NULL, buflen, mode);
#endif
#ifdef USE_SEGGER