11 years, 4 months ago.

printf isn't working correctly

In the smoothie shell prompt, it responds incorrect characters when input 'ls' command. /media/uploads/Pauljay/t1.jpg 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

11 years, 3 months ago.

itha apdiye thanjavur kalvetla eluthivechtu pakathulaye otkanthuka... unaku pinnadi vara santhathigal pathu padichu theliva nadanthukuvanga....

11 years, 3 months 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.