Reading Encoder strip values in P2
I am creating sample code in c++ to read encoder strip values.
This is used for calculate motor steps for DC motor.
previously i was using QEI library for Nucleo 144(https://os.mbed.com/teams/IoTKitV3/code/QEI/docs/tip/QEI_8cpp_source.html).
And using QEI lib with X2_ENCODING macro i am getting proper values in Nucleo144 board.
So i am creating similar support for P2. In QEI lib there is ISR which is continuously checking pulses for Forward and reverse directions.
So for P2 i have created this function to run on another cog to monitor pins.
But i am not getting proper values in P2. for forward direction its taking both forward and reverse pulses and same for backward direction also.
And i am sure that its not about calculation(ISR in QEI lib code) because same calculation works in Nucleo 144 board. So not sure whats wrong here. attaching my sample code for P2.