Debugging todayProgram, FoundARM-GCCLowerSprintf ()It does not support floating point numbers. I have never encountered this problem before, and I think it will certainly not be a problem.Adl_user_guide.ARM-GCCUnderSprintf ()Not Supported% FThe document provides the corresponding solution.
Important remark about GCC compiler:
When using GCC compiler, due to internal standard C Library Architecture, it is stronugly not recommended to use the "% F" mode in the wm_sprintf function in order to convert a float variable to a string. this leads to an arm exception (product reset ).
A way around for this conversion is:
Float myfloat; // float to display
ASCII mystring [100]; // destination string
S16 D, F;
D = (S16) myfloat * 1000; // decimal precision: 3 digits
F = (myfloat * 1000)-D; // decimal precision: 3 digits
Wm_sprintf (mystring, "% d. % 03d", (S16) myfloat, f); // decimal precision: 3 digits
Practice has proved that it is important to read documents rather than experience.