View Single Post
  #9   Spotlight this post!  
Unread 09-02-2007, 14:29
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Disable Encoders Problem

Quote:
Originally Posted by TimCraig View Post
I've never understood the && with the enable bit in the interrupt handler. If the interrupt isn't enabled, there will be no jump to the interrupt vector so that test will never be executed. Without the interrupt enabled, it's just an ordinary input pin.
There is only one (low-priority) interrupt handler. It will be called when any interrupt occurs, and the handler has to check all the possible sources in order to service the interrupt properly. The program won't know not to deal with a flag for a disabled interrupt unless you also check the associated enable bit. You don't really want a serial port interrupt to end up running the service routine for a "disabled" encoder.