Re: [EE] Saving "printf" arguments for later? Real-time on slow processor.
James Cameron <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.pic |
|---|---|
| Message-ID | <[email protected]> |
Yes, Serial depends on Stream and both are C++, so you get all the features you might need and then some. To see the details, build with a link map. You'll get sizes of code linked in, and can experiment to reduce. The source code is also available. Yes, printf() will reduce the footprint. printf() in that environment is less capable than printf() on a PC or UNIX, but still it is large, because of all the parsing of format string. As you're using the ESP32 Arduino core, you might, depending on versioning, be able to dig further still, removing printf in favour of putc, or uartWriteBuf after include of esp32-hal-uart.h - a direct C only API without C++. Give PlatformIO a try if you get a spare moment or computer. There's also https://wokwi.com/ which can expose more details of how things can work, much of which you can pull back into your projects on the Arduino IDE. Arduino IDE is a simplified C++ environment.