This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Float to ASCII conversion without using sprintf function

Hello,

I am removing all sprintf() function from my souce code as this function does not allow me to set the proper thread stack size. Does anyone have any function that implements this conversion?

Thanks
Andre Moutinho

Parents
  • Yes, the proper stack size because of the keil anaysis tool cannot perform 100% with functions such as sprintf(). I am already using the stack "paint" method but this is not a safe option for implementing complex systems on an embedded environment. I should have to run tests to guarantee the code is working but it is very complex and time consuming. I prefer trust on analysis tools instead.
    Implementing ftoa() is not difficult but I usually always try findining something ready instead of implementing everything. I have found some on google.
    Thanks
    Andre

Reply
  • Yes, the proper stack size because of the keil anaysis tool cannot perform 100% with functions such as sprintf(). I am already using the stack "paint" method but this is not a safe option for implementing complex systems on an embedded environment. I should have to run tests to guarantee the code is working but it is very complex and time consuming. I prefer trust on analysis tools instead.
    Implementing ftoa() is not difficult but I usually always try findining something ready instead of implementing everything. I have found some on google.
    Thanks
    Andre

Children
  • Note that the use of sprintf() only affects tree branches using it.

    It isn't too hard to get a good estimate of stack depth from sprintf() itself for relevant formatting strings and parameter sets.

    The world have managed quit well with setting stack sizes without automatic tools at times when four bytes extra stack costed too much to waste - and where all your interrupts used the same stack. If you have only one thread with sprintf() then it really isn't too costly to add in a safety margin.