Sprintf function blocking  the program

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DeAa_335316
Level 4
Level 4
First like received

Hello,
my program stuck at sprintf function .On UART screen it showing up to ADC3= ... then could not able to print pablisher value..  

   

UART_UartPutString("ADC3=");
 Adc_float=conversion*ADC_FACTOR; 
 sprintf( pablisher,"%.2f",Adc_float); //"%.4f"
 UART_UartPutString(pablisher);

   

Best Regards
Deepak

0 Likes
4 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

No ADC readings in Conversion would be my guess. So Conversion =0 . Please post your complete code.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Check heap size (in System view), must be set to 0x0200 or printing floats goes el wracko.

   

 

   

Bob

rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Try these settings and this program.

   

   

0 Likes
DeAa_335316
Level 4
Level 4
First like received
        Thanks Bob Marlowe.. After changing the heap size it is working fine .. not stuck at run time Bobgoar- First I try your advice but the problem was same