EH
Starting Member
- Total Posts : 54
- Reward points : 0
- Joined: 2010/11/28 03:09:31
- Location: 0
- Status: offline
XC8 cannot set function to ISR_Vector
Hi Community, I`m using the PIC18F1320 together with the MPLAB X IDE 5.40 plus XC8 v2.10. I want to place a function to the ISR-Vector, so as desribed in the docs, I used the "void interrupt isr(void)" instruction for it. But when I`m duing this, I get a error message, that the compiler is detecting a incomplete type "void" and expecting a ";" after top level declarator. See the picture. What I have to do else, that the compiler is satisfied. Thank you for the support Henry
Attached Image(s)
|
domble
Super Member
- Total Posts : 196
- Reward points : 0
- Joined: 2007/01/25 04:11:53
- Location: UK
- Status: offline
Re: XC8 cannot set function to ISR_Vector
2021/01/18 08:20:43
(permalink)
From the PIC18F project I'm working on right now... void __interrupt(low_priority) low_isr(void) { // low priority interrupt code here } void __interrupt(high_priority) high_isr(void) { // high priority interrupt code here }
dom p.s. projcects? :-P
|
mbrowning
USNA79
- Total Posts : 1875
- Reward points : 0
- Joined: 2005/03/16 14:32:56
- Location: Melbourne, FL
- Status: offline
Re: XC8 cannot set function to ISR_Vector
2021/01/18 09:30:40
(permalink)
I think you are using XC8 in C99 mode, but the interrupt syntax you are trying to use is from C89/C90 mode. Check the compiler manual (section 4.9.1 for C99 mode) for proper interrupt syntax, or change mode to C90.
|
ric
Super Member
- Total Posts : 29951
- Reward points : 0
- Joined: 2003/11/07 12:41:26
- Location: Australia, Melbourne
- Status: online
Re: XC8 cannot set function to ISR_Vector
2021/01/18 12:16:13
(permalink)
To get a useful answer, always state which PIC you are using!
|
EH
Starting Member
- Total Posts : 54
- Reward points : 0
- Joined: 2010/11/28 03:09:31
- Location: 0
- Status: offline
Re: XC8 cannot set function to ISR_Vector
2021/01/19 02:32:07
(permalink)
Hi All of the responders, thank you for your hints. Seems I was not up to date. So, I`ll study the news. Greetings Henry
|
domble
Super Member
- Total Posts : 196
- Reward points : 0
- Joined: 2007/01/25 04:11:53
- Location: UK
- Status: offline
Re: XC8 cannot set function to ISR_Vector
2021/01/19 03:14:56
(permalink)
|
ric
Super Member
- Total Posts : 29951
- Reward points : 0
- Joined: 2003/11/07 12:41:26
- Location: Australia, Melbourne
- Status: online
Re: XC8 cannot set function to ISR_Vector
2021/01/19 03:28:44
(permalink)
Plainly that was written long before v2.xx was ever thought of. The top of the source says (with a mis-spelling): So plainly it was written for 1.xx, and they never imagined it changing. "or higher" turned out to be over optimistic.
To get a useful answer, always state which PIC you are using!
|
1and0
Access is Denied
- Total Posts : 12108
- Reward points : 0
- Joined: 2007/05/06 12:03:20
- Location: Harry's Gray Matter
- Status: offline
Re: XC8 cannot set function to ISR_Vector
2021/01/19 03:34:05
(permalink)
ric Plainly that was written long before v2.xx was ever thought of. The top of the source says (with a mis-spelling):
So plainly it was written for 1.xx, and they never imagined it changing. "or higher" turned out to be over optimistic.
With the given changes, it would be nice if XC8 compiler outputs a more useful message. ;)
|
mlp
boots too small
- Total Posts : 1005
- Reward points : 0
- Joined: 2012/09/10 15:12:07
- Location: previously Microchip XC8 team
- Status: offline
Re: XC8 cannot set function to ISR_Vector
2021/01/21 19:02:21
(permalink)
1and0 With the given changes, it would be nice if XC8 compiler outputs a more useful message. ;)
Can't output a "more useful message" without investing developer time. Can't invest developer time without a pressing customer use case. Buy <enough> chips every <time-period> and demand your "more useful message" - you'll get it. But you will have to wait longer for other fixes. Your call. When I say "Buy <enough> chips every <time-period> and demand X" this is a statement from experience. A customer wanted to be able to limit the scope of (some) optimizations so they could (if I recall) guarantee byte-identical binaries to what they had got from a pre-OCG compiler so they would not need to pay to get their code re-certified by some external body. They bought enough chips that management pulled us off actual useful development to add this new "feature". It took months, and other fixes were delayed. The presence of the option still confuses users who try turning it on because it's there (I see them here on the forums). It's there, and insufficiently documented to dissuade them from trying it because we were not allowed to document it as "really, just for the special-case requirement of Customer X - if you're not them, it will break things."
Mark (this opinion available for hire)
|
1and0
Access is Denied
- Total Posts : 12108
- Reward points : 0
- Joined: 2007/05/06 12:03:20
- Location: Harry's Gray Matter
- Status: offline
Re: XC8 cannot set function to ISR_Vector
2021/01/22 01:02:03
(permalink)
mark.pappin Can't output a "more useful message" without investing developer time. Can't invest developer time without a pressing customer use case.
I guess it must be too much to ask for it to recognize the keyword "interrupt" and flag a useful message when it is used in C99 mode. Buy <enough> chips every <time-period> and demand your "more useful message" - you'll get it. But you will have to wait longer for other fixes. Your call.
I buy <zero> chips ... ;)
|