Simple Printf on CF question

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

Simple Printf on CF question

4,050件の閲覧回数
dvona
Contributor II

I'm trying to do a simple print of a floating point number out of a UART, and cannot figure out why I can’t seem to use a printf statement to display floating point values? For example

printf("\ntest printf with float = %5.2f", 1.23456);

results in just the letter “f” printed from hyperterminal: test printf with float = f.

Is there something I need to do because I am not on a floating point machine to enable printf to print floats?

 

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

552件の閲覧回数
nanoGeek
Contributor I
Make sure your project is not using a simpler version of printf (printD and/or printk).  One of the projects I have imported in the past (dbug for CF) uses printD which calls printk (which has no floating point support) with a #define printf printD.
 
0 件の賞賛

552件の閲覧回数
CrasyCat
Specialist III
Hello
 
 It works for me.
 
 Which version of Codefire tools are you using (V6.2, ...)?
 Did you include the file stdio.h at the beginning of the source file?
 
 Which runtime libraries are you linking to your application?
 For which CPU are you generating code (MCF5282, ...)?
 
CrasyCat
0 件の賞賛