Re: [EE] Saving "printf" arguments for later? Real-time on slow processor.

Isaac Marino Bavaresco <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.pic
Message-ID <[email protected]>
Is it possible for you to replace que calls to 'printf' with calls to 
different functions depending on the specific formatting?

If so, each function would know exactly what it is receiving as 
parameters and simplify the saving of the data. Those functions could 
even receive an additional parameter telling them if they should save 
the parameters or printf them.


Cheers,

Isaac



Em 20/01/2025 09:21, peter green escreveu:
> On 16/01/2025 21:45, Jason White wrote:
>> I've reached the conclusion that my best bet is to write a wrapper for
>> printf.
>> The wrapper would save the printf format string, and variadic 
>> arguments to
>> a buffer so that I can process the printfs later when the CPU is idle.
>> I think I can get away with this since all of the printfs just contain
>> numbers and short (~8 byte) strings.
>
> Unfortunately the nature of variadics in C is that no type information
> is passed to the receiving function. So you have to perform at least
> some basic parsing of the format string to determine the parameter
> types you are working with.
>
> Not nessacerally a showstopper, but something to bear in mind.
>

-- 
O software antivírus Avast realizou uma checagem de vírus neste e-mail.
www.avast.com

-- 
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
https://mailman.mit.edu/mailman/listinfo/piclist
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.