I was working at home this weekend and I left my USB to Serial adapter at the office. My office is only 4 miles from home, but I didn’t feel like driving all the way there.  But I almost did because I needed to capture the RETAILMSG output from an application that I was working on. I wasn’t using them so much for debugging, but instead to output some data. I decided to redirect the output and skip going to the office.
The first thing that I did was to modify the application to use printf instead of RETAILMSG. This is Windows CE, so I used wprintf by redefining RETAILMSG as:
#define RETAILMSG( X, Y ) wprintf Y
I could have used:
#define RETAILMSG( X, Y ) if( X ) wprintf Y
But all of my conditions are positive, so that would have been overkill.
So now all of my RETAILMSGs will be output to the command window, which I have in my OS. If you don’t have a command window, then this won’t be much help but with some imagination you could also use this to output to a file.
The next problem that I ran into was that I didn’t have a mouse, and I am just too lazy to re-calibrate my touch screen so that I can scroll the output in the command window. So I redirected my output to a file:
\> MyApp >> “\Storage Card\output.txt”
So now I can take the file to my laptop and check the data.
Copyright © 2008 – Bruce Eitman
All Rights Reserved