Quote:
Originally Posted by lukevanoort
You could basically copy and paste the code from the encoder driver's ISRs into the ISRs in this version (or put them in another file and call them from the ISRs, which would probably be more readable) and add the Get_Encoder_x_Count() function. Actually, if you just didn't call the initialization functions, you could probably use the current encoder code verbatim (well, for encoders one and two anyway, for 3-6 you'd probably just want to reuse the code from encoder 1-2 instead of the encoder driver's functions for encoders 3-6). I would say that it would probably be less than 20mins to code.
|
Thanks. For now, I commented out the code for encoders 3-6, and I use the code for 1 and 2 by having the Int_1_Handler() in interrupts.c call on Encoder_1_Int_Handler() in encoder.c. This sounds like it should work, and I'll post here if it works or if it fails and I can't figure it out by myself.
How about gyros? I noticed that your gyro code from last year uses both gyro.c/h and adc.c/h. I copied both of thme, and I've been fumbling for a while with integrating them and timers.c. I have not been able to do that yet, generating a red-light-of-doom in the process. Any ideas or advice?
EDIT: Kevin, I believe I may have found a problem. Interrupts.h uses #define ENABLE_INT_# (for # being 1,2,...), while ifi_frc.c checks #ifdef ENABLE_INTR_# when checking for the ISR. That is an oversight, right? I searched the rest of the files and could not find another reference to ENABLE_INTR_#.