-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consider this printf implementation with stdio fopencookie function #4713
Comments
The suggested code snippet doesn't have any explanation or context. Nothing to do here. If you have a need for this, I suggest making a PR with an example or some explanation. Closing as an issue. |
@JAndrassy I also don't understand the intent here. If you provide a more detailed explanation and examples we can discus it. |
current implementation of printf in Print in esp8266 core calls vsnprintf twice and uses dynamic allocation of buffer, if the resulting string doesn't fit into 64 bytes. I would guess that a lot of printf uses have the result larger then 64 characters. the proposed implementation writes to output the result of formatting directly with write(byte). I use this implementation in StreamLib , a library for all architectures. This printf implementation works for xtensa and for ARM. For AVR the implementation with the same concept is slightly different. I use the StreamLib in my project with many different printfs. The project ran months on esp8266. Now it is on M0. In AVR core this way of implementation of printf was proposed but not merged yet. |
Hi. The solution is correct, it will work fine. I have already added a completely similar way of printf() in arduino STM32. In my profile there is a fork Arduino Stm32. In the branch for Stm32F1 there is already a ready source print.с Bonus, for Arduino Uno, too, there is a similar solution. |
The text was updated successfully, but these errors were encountered: