This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

printf formatting . . .

I recently had to re-install Windows XP, which also meant I had to reinstall Code Composer Studio  Version: 4.1.2.00027.  Since my re-install, sprintf() has acted strangely.  this instruction "sprintf(strMSG, "%0.1f C\0", fTemp);" constructs "0.1f C".  Similarly, sprintf() will work just fine until I add the format characters.  I made sure the include path is correct, and I also enabled "-pdsw225". 

I am most likely having a case of mental constipation, but, can anyone point me in the right direction?

Thanks,

  • Lane,

    Which device are you compiling for - is it MSP430? Please check what the --printf_support option is set to in your project. It would be under Project Properties->CCS Build->Compiler->Library Function Assumptions. For float format, you would need to enable full support. This wiki page has some details.

  • That was it.  I had set that earlier, but, for some reason it did not stick.  I hit "apply" a couple of times and re-entered to make sure that it stuck.

    Thank you,

    Lane