LPC54628 Printf Floating numbers doesnt have minus sign

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC54628 Printf Floating numbers doesnt have minus sign

9,172件の閲覧回数
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

 

 

ラベル(2)
0 件の賞賛
1 返信

9,153件の閲覧回数
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 件の賞賛