All,
I've used sprintf with no problems many times. But in my current program when I try and print out a floating point number I just get question marks.
sprintf(buffer, "%f", 4.1);
After running that line, buffer contains the string: "???"
Is there maybe a compiler option that is disabling floating point?
Thanks, Matt
... why not just insert somewhere a = 4.7 * 5.2 and see what happens.
sometimes a quick test is waaaay faster than a forum discussion.
Erik
I did try that. The math works but sprintf just prints out "???"
I think I've tried all the "quick" things. I tried %g instead of %f but the same thing. int, strings, unsigned ints and unsigned long ints seem to work just fine.
The problem appears to only be with floats.
The unique thing about this card is that it talks to the CP2200 Ethernet chip and I have used the Silicon Labs TCP-IP Configuration wizard and included:
mn_stack_bank_038.lib mn_stack_common_038.lib mn_callback.c mn_vars.c
When I add these to a test project I get it to fail in the same way.
Is there something in those library files overwriting how sprintf works?
Appearently printf is being pulled in from the mn_stack_common_038.lib file and not the standard file. Probably no way to include both, guess I'll use ftoa examples and create my own function.
So have you asked Silicon Labs about this?
If they're overloading printf, they should provide a complete implementation - or some way for you to get at the original...