• AVR Freaks

Hot!Pre-processor directives not working

Author
Radsolution
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/03/23 03:59:00
  • Location: 0
  • Status: offline
2020/07/07 09:07:24 (permalink)
0

Pre-processor directives not working

Hello,
I added 2 directives, as per this page: conditionals-in-project-configurations,
called K83 and K80 to specify 2 different builds of the source.
 
However, using the following source code doesn't appear to recognise the defined values:
#ifdef K83
 LIST P=18F26K83,r=hex,N=75,C=120,T=ON
 include p18f26K83.inc 
#else
 LIST P=18F25K80,r=hex,N=75,C=120,T=ON
 include p18f25k80.inc
#endif

as both sections of the code are active; neither has been shown in a disabled colour.
 
Have I done something wrong, or is there a bug in MPLAB X v5.25 ?
#1

1 Reply Related Threads

    crosland
    Super Member
    • Total Posts : 2009
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: Pre-processor directives not working 2020/07/07 09:31:03 (permalink)
    +1 (1)
    The IDE is notorious for not parsing source code correctly, but I don't know if that affects assembly code.
     
    What happens if you actually try to build with each macro?
    #2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5