16f15324 ei() not a recognized symbol

Author
ideaman4u
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2016/11/21 15:12:36
  • Location: 0
  • Status: offline
2018/04/15 15:07:22 (permalink)
0

16f15324 ei() not a recognized symbol

Weird one.  Building a minimal test project (no pragma settings) using xc8 1.45 on the subject processor (PIC16F15324). ei() macro is not recognized causing compiler error. Simply removing it allows compiling.  Note that most (have not tried exhaustively) other symbols are recognized including, for example, GIE = 1.  I know I can substitute GIE = x, but this begs the question as to what other anomalies am I possibly missing.  Anybody have any insight?
 
Attached is just how simple the main C code is to create the problem.  
Sam
 
#1

5 Replies Related Threads

    qɥb
    Monolothic Member
    • Total Posts : 2094
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: online
    Re: 16f15324 ei() not a recognized symbol 2018/04/16 16:52:23 (permalink)
    +1 (1)
    It seems to be a compiler bug to me, which affects all PIC16F153xx processors.
    xc.h pulls in pic.h, which contains this:
    #if defined(_PIC14) || defined(_PIC14E)    
    #ifndef    ei
    #define    ei()    (GIE = 1)    // interrupt enable bit
    #endif 

    so presumably neither _PIC14 nor _PIC14E is defined.
    There does appear to be a new value, "_PIC14EX" in some of the header files, and that is defined for the PIC16F153xx family, so my guess is that the code in pic.h should be changed to
    #if defined(_PIC14) || defined(_PIC14E)  || defined(_PIC14EX)     
    #ifndef    ei
    #define    ei()    (GIE = 1)    // interrupt enable bit
    #endif 

    This probably affects some other details too though...
     

    PicForum "it just works"
    #2
    ideaman4u
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2016/11/21 15:12:36
    • Location: 0
    • Status: offline
    Re: 16f15324 ei() not a recognized symbol 2018/04/16 17:54:35 (permalink)
    0
    I too looked down the header "tree" and noticed reference to header pic.h.  But I did not pursue it.  Wonder why _PIC14?
     
    I have a knack for finding compiler bugs.  Somehow, I always seize on a PIC that has some issue that delays me for days.  Somewhat frustrating.  
     
    Don't get me wrong, I do love PICs in general and have used for some projects with great success.  I just hope that Microchip is not taking on too much with the acquisition of the Atmel line.  
     
    Thanks for your help and insight.  Much appreciated,
    Sam
     
    #3
    qɥb
    Monolothic Member
    • Total Posts : 2094
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: online
    Re: 16f15324 ei() not a recognized symbol 2018/04/16 18:32:51 (permalink)
    0
    n.b. I've cross-posted your question to the XC8 forum.
    ei() macro not defined for PIC16F153xx devices 

    PicForum "it just works"
    #4
    ideaman4u
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2016/11/21 15:12:36
    • Location: 0
    • Status: offline
    Re: 16f15324 ei() not a recognized symbol 2018/04/16 18:34:03 (permalink)
    0
    Thanks.
    Sam
     
    #5
    mad_c
    Super Member
    • Total Posts : 1054
    • Reward points : 0
    • Joined: 2010/12/12 17:48:27
    • Location: Brisbane, Australia
    • Status: offline
    Re: 16f15324 ei() not a recognized symbol 2018/04/17 14:45:35 (permalink)
    0
    This has been reported. Please see here. I missed that there was a seperate thread.
     
    Jeff.
     
    #6
    Jump to:
    © 2018 APG vNext Commercial Version 4.5