LPC54628 Printf Floating numbers doesnt have minus sign

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC54628 Printf Floating numbers doesnt have minus sign

7,243 Views
alpcaner92
Contributor I

Hi,

I have a  LPC54628 dev board. Im trying to print signed floating numbers, however negative sign is not printed. 

I did the following changes which works for decimal numbers but not floating numbers. 

PRINTF_ADVANCED_ENABLE=1

PRINTF_FLOAT_ENABLE=1

 

Here is the code. 

Current = -0.001A

SHELL_Printf(" %.4fV  %fA\r\n",temp,Current);

 

I tracked down to the inner functions of Printf, I found out that the sign is lost during casting. 

 

alpcaner92_0-1615056512950.png

fval loses the sign after cast. This function is in fsl_str.c file. 

Can you help me? 

 

Regards,

Caner

 

 

Labels (2)
0 Kudos
1 Reply

7,224 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

Please choose Newlib to test:

Alice_Yang_2-1615258035503.png

 

Alice_Yang_1-1615257821985.png

 

Regards,

Alice

 

 

 

0 Kudos