Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Macros Running a Program on the Target Compiling and Linking with On Time RTOS-32 |
MacrosConfiguration file macros can be defined using the Macro and EndM keywords: Macro Name [Parameter...] ... EndM Up to 8 parameters and 256 source lines per macro are supported. Macro declarations cannot be nested, but macro invocations can be nested. Macros are expanded by specifying the macro name followed by parameters. Numeric parameters are evaluated and then passed (they are not passed as strings). Not all parameters need to be specified. Inside the macro, #ifdef can be used to test if a parameter was specified. Macro expansions can be nested up to 15 levels deep. Please refer to configuration file Bin\Bootdbg.cfg for numerous example macros. Example:#include <Bootdbg.cfg> #define BOOTMODE REAL Macro MEM_CHECK ADDR LEN // macro to test RAM and display results OUT_NUM ADDR // display start address OUT_CHAR SLASH // display "/" OUT_NUM LEN // display length OUT_STR " = " // display " = " RAM_TEST ADDR LEN // perform RAM test OUT_NUM // display FFFFFFFF if RAM is OK OUT_STR "\r\n" // new line EndM INIT_UART // use same UART as Monitor MEM_CHECK 0 256k MEM_CHECK 1M 1M Would produce the following output on the serial port set up with the COMPort command: 00000000/00040000 = FFFFFFFF 00100000/00100000 = FFFFFFFF
|