Solved
[Solved] How can I print an Integer
Posted on July 01, 2015 at 12:14
Hello.
I use the board SPC560P-DISP. How can I print an Integer with Tera Term through a serial connection? I use the function chnWriteTimeout to print a string. So:chnWriteTimeout(&SD1, (uint8_t *)
''Hello World!\r\n''
, 14, TIME_INFINITE);
But an Integer?
I tried to use chprintf, but not working.
It does not recognize the function chprintf. I included the header chprintf.h
uint32_t number=25;
chprintf(&SD1,
''%u \n\r''
, number);
The error is:
main.c:(.text_vle.main+0x10c): undefined reference to `chprintf'
collect2: ld returned 1 exit status
make: *** [build/
out
.elf] Error 1
In the demo of SPC5 Studio for my board they use only chnWriteTimeout.
Best regards
Gianluca.