CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Suggestions for ISR code... int_global or ??

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

Suggestions for ISR code... int_global or ??
PostPosted: Fri Jul 31, 2009 1:42 pm     Reply with quote

I have an application I'm writing where I have 4 identical devices on INT0 through INT3 on a PIC18F97J60.

For the proto - I kept them separate for other coding reasons, but now that I see I might be able get along with optimizing them.

Now, this means I could write 4 of the same ISR's that are prefaced with
#EXT_INT0 (,1,2,3)

But I'd like to avoid having the potential for 4 sets of code -- although they have some differences (basically addresses they access).

So I either write a routine that gets inserted 4 times using the #inline or I write a global ISR (not feeling so great about that).

I haven't considered if it can even be done to define a single ISR routine written as such: (literally)

Code:

#INT_EXT0
#INT_EXT1
#INT_EXT2
#INT_EXT3
void isr_routine () {

}


EDIT: Nevermind - the above doesn't work. Embarassed

I'd like to hear from the coders with experience writing weird ISR and maybe custom global interrupt handlers.

Thanks!
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jul 31, 2009 2:05 pm     Reply with quote

This thread discusses your problem. See Ttelmah's response and
the orginal poster's decision:
http://www.ccsinfo.com/forum/viewtopic.php?t=36791
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Jul 31, 2009 2:35 pm     Reply with quote

That's definitely one way of doing it...

Right now I have a routine that's called with a parm by the 4 different IRQ's.

Anyone else?

-Ben

p.s. thanks PCM
p.p.s. the #INT_DEFAULT description in the CHM Help could be a LOT better worded.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group