Skip to content

Commit

Permalink
200d: copy console printf to uart, add CONFIG flag
Browse files Browse the repository at this point in the history
CONFIG_COPY_CONSOLE_TO_UART makes printf() in console.c
also output to uart.  Designed for debugging, not tested
extensively.  Spamming uart too hard to lock it up.
  • Loading branch information
reticulatedpines committed Mar 23, 2024
1 parent 9b35172 commit 9a0f0b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions platform/200D.101/features.h
Expand Up @@ -18,6 +18,9 @@
// dumping all the images that old cams support
#define FEATURE_SCREENSHOT

// duplicate all printf (console) output to uart
#define CONFIG_COPY_CONSOLE_TO_UART

// cam doesn't expose call("TurnOnDisplay"),
// (or TurnOffDisplay), so we must find stubs
// and call directly
Expand Down
4 changes: 4 additions & 0 deletions src/console.c
Expand Up @@ -330,6 +330,10 @@ int printf(const char* fmt, ...)
int len = vsnprintf( buf, buf_size-1, fmt, ap );
va_end( ap );
console_puts(buf);
#ifdef CONFIG_COPY_CONSOLE_TO_UART
extern int uart_printf(const char *fmt, ...);
uart_printf(buf);
#endif
return len;
}

Expand Down

0 comments on commit 9a0f0b2

Please sign in to comment.