
Originally Posted by
cncmachineguy
So we CAN pass things to the .BAS just not the .INC?
...
tells PBP or MPASM (not clear here) to see if the DEFINE exists. If not then do the following code. If it does exist then endif.
DEFINE's are currently only passed on to the assembler unchanged, and do not directly affect PBP code.
Those DEFINES are added to the ASM after the .inc file, but before the .bas file.
This allows them to affect the library code that is included from the .bas file, but the items in the .inc file have already been processed.
The example above was for an 18F.
For a 16F, the .cfg file should be a little different
Code:
' -- 16F877a.cfg --
ASM
ifndef PM_USED
ifndef CONFIGOVERRIDE
__config _XT_OSC & _WDT_ON & _LVP_OFF & _CP_OFF
endif
endif
ENDASM
The usage in the main program is essentially the same.
Code:
DEFINE CONFIGOVERRIDE
@ __config _HS_OSC & _WDT_ON & _LVP_OFF & _CP_OFF
A better method has been developed by Charles and Leonard that allows defaults to be overridden automatically, and the new style CONFIG statements to be used in your programs as well.
It will be available in the coming months, so you may not want to spend to much time editing all the files.
Bookmarks