DEBUG MACROS

Compact 7 running under Platform Builder supports a raft of debug macros that formalize the insertion of print statements in code for debug purposes, as shown in Table 34-2. They are generally conditional, in that there is a Boolean expression that is evaluated to determine if the output is to occur. Some macros can be globally turned off and on. They are generally also dependent upon the type of operating system build. There are simple “Writeline” style macros such as RETAILMSG and DEBUGMSG. There are also the DEBUGZONE (and RETAILZONE) macros for code location specific messages. There are also assert macros.

TABLE 34-2: Compact 7 Debug Macros

MACRO OS BUILD MODE DETAILS
RETAILMSG Any except Ship Conditionally outputs to the Debug window in printf format
DEBUGMSG Debug, Checked As per RETAILMSG
ERRORMSG Any except Ship As per RETAILMSG but message with "ERROR"
DEBUGZONE Debug Combined with DEBUGMSG and other macros, can turn debug messages on and off within a certain region (zone) of code (within a function)
ASSERT Debug and Checked Evaluates the supplied parameter expression and performs a DebugBreak if false; doesn’t require dpCurSettings as used in DEBUGMESSAGEZONES
DEBUGCHK Debug and Checked As per ASSERT but requires dpCurSettings
ASSERTMSG Debug and Checked As per ASSERT but outputs supplied message as well
RETAILLED Any except Ship Conditionally outputs pattern using WriteDebugLED, which is implemented by OEM in NLED driver
DEBUGLED

Get Professional Windows® Embedded Compact 7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.