Quote:
Originally Posted by Ianuser
Code:
void Encoder_2_Int_Handler1(void)
{
// Encoder 2's phase a signal just transitioned from zero to one, causing
// this interrupt service routine to be called. We know that the encoder
// just rotated one count or "tick" so now check the logical state of the
// phase b signal to determine which way the the encoder shaft rotated.
Encoder_22_Count += ENCODER_2_TICK_DELTA;
}
#endif
#ifdef ENABLE_ENCODER_3
?
|
I don't know where the "_22_" came from, but the logic (such as it is) is correct. However, I was hoping you'd also think to correct the comment to explain what you did and why you did it. Someone (perhaps
you) is going to be reading this code later, and it will help to have comments that actually describe the code.