Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5904

SDK • Re: Intercepting printf() calls, redirecting to a ring_buffer, sending to a UART later

$
0
0
Wow! I found that within the SDK's

Code:

stdio.c
file, there's this:

Code:

int __printflike(1, 0) WRAPPER_FUNC(printf)(const char* format, ...){    va_list va;    va_start(va, format);    int ret = vprintf(format, va);    va_end(va);    return ret;}
This appears to me that the

Code:

printf(...)
function is already wrapped!

In fact, when compiling I see this:

Code:

pico-sdk/src/rp2_common/pico_stdio/stdio.c:275: multiple definition of `__wrap_printf';
So... looks like this is the right direction, but I don't know how to "not wrap" the default, or to "re-wrap" the default.

I'll keep checking...

Statistics: Posted by shreeve — Tue Mar 05, 2024 2:02 am



Viewing all articles
Browse latest Browse all 5904

Trending Articles