cancel
Showing results for 
Search instead for 
Did you mean: 

Avoiding snprintf

PBU
Associate III

Is it possible to avoid using snprintf in TouchGFX. Is there any alternate method available to copy values in the buffer and display it without using snprintf.

6 REPLIES 6
Martin KJELDSEN
Chief III

I'm assuming you mean Unicode::snprintf() (which is a TouchGFX function). Why don't you want to use it?

/Martin

Hi Martin,

Yes Unicode::snprintf(). I don't want to use that because snprintf uses dynamic memory allocation. There might be changes for creating memory fragmentation right? also due to performance issues.

Bob Bailey
Senior

did you ever get an answer? I have a similar question. For other embedded applications with limited processor power I used a simple int-to-string function. I was displaying a lot of fast-changing numeric data and the library functions were too inefficient and big.

No, I didn't get an answer yet.

For a limited number of types or options, it would make sense to write the binary-to-string conversion functions yourself.

I stated in my original post that Unicode::snprintf is a touchgfx function. We use no dynamic allocation.

/Martin