Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
12 years, 1 month ago.
printf isn't working correctly
In the smoothie shell prompt, it responds incorrect characters when input 'ls' command.
Below is an excerpt from the Gcodedispatch.cpp.
I've manually added a code line to check printf is working correctly.
As you see in the image, printf ( default USB serial ) is working correctly.
But new_message.stream->printf wsn't.
Whenever there is an argument, message.stream->printf never shows correct strings.
Only no argument constant strrings are displayed correctly though.
Dispatch message!
this->kernel->call_event(ON_GCODE_RECEIVED, &gcode ); new_message.stream->printf("ok\r\n"); new_message.stream->printf("ok %c\r\n", 'G'); printf("ok %s\r\n", single_command.c_str());
Question relating to:
2 Answers
12 years, 1 month ago.
itha apdiye thanjavur kalvetla eluthivechtu pakathulaye otkanthuka... unaku pinnadi vara santhathigal pathu padichu theliva nadanthukuvanga....
12 years, 1 month ago.
Does it work fine when you have for example a Serial pc(USBTX, USBRX), and then do pc.printf? If that works I would assume the library does something wrong with the arguments. The printf argument isn't like normal arguments for functions but a bit different.