Hi everybody, I just want to know if there is anyone who had debugged the printf function using a modified putchar.c file. This is becasue my project which uses my own putchar.c file added to my project was compiled without any error nor warning. However when simulating the program I expected that once arriving at the statement printf the program cursor or execution jumped to my putchar.c file instructions(putchar function inside) carring the first character of the printf message, but not, it continues with the following statement in my main(caller)file which is a delay. My question is: How can I see , under debugging mode, that the printf effectively calls the putchar.c file and continues with the execution of the putchar function code? I appreciate so much your help. Regards OmarE
A breakpoint on your own putchar() should do the trick.
Hi Hans, Thank you so much. It really works. Thanks to that, I realized I have a problem in my putchar() function. I want to switch the printf between LCD and UART by a varible I call it: putchar_target. I defined the varible in putchar file but my code file does not understand it. I did in my main file, but the putchar() does not understand. Where should I declare the putchar_target in order to the main code file and putchar file understand it? OmarE
I defined the varible in putchar file but my code file does not understand it That description is useless. One of the oldest well-known facts about computer is that they dont' "understanding" anything. Never have, and there's doubt they ever will. Code files understand even less. So: what did you actually do, and how did it fail to work out?