chprintf(syscon, "%f", 0.12345678);
prints only one character "f"
ChibiOS 3.0.2 Stable
Float chprintf
Moderators: RoccoMarco, lbednarz, tfAteba
Re: Float chprintf
According to source code (.\hal\lib\streams\chprintf.c) you should activate %f with:
#define CHPRINTF_USE_FLOAT TRUE
#define CHPRINTF_USE_FLOAT TRUE
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Float chprintf
Correct, floats are optional because code size concerns.
You may also add the macro in the Makefile using -DCHPRINTF_USE_FLOAT=1
Giovanni
You may also add the macro in the Makefile using -DCHPRINTF_USE_FLOAT=1
Giovanni