When i used 2 external interrupt for encoder and one timer for calculate my program crash and get this error
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x400848ac PS : 0x00050031 A0 : 0x800d1976 A1 : 0x3ffbf34c
A2 : 0x00000010 A3 : 0x00018010 A4 : 0x000637ff A5 : 0x3ffbf32c
A6 : 0x00000008 A7 : 0x3ffbdc2c A8 : 0x00000000 A9 : 0x00000000
A10 : 0x000000c8 A11 : 0x3ffc244c A12 : 0x80081419 A13 : 0x3ffbf30c
My first thought was that the interrupt execution time was over so i increase interrupt timer but still the same. And i found that in file encoders.cpp inside function update_encoder() when i commented out
s_robot_fwd_increment = 0.5 * (right_change + left_change);
s_robot_rot_increment = (right_change - left_change) * DEG_PER_MM_DIFFERENCE;
speed_robot_now=s_robot_fwd_increment*LOOP_FREQUENCY;
s_robot_position += s_robot_fwd_increment;
s_robot_angle += s_robot_rot_increment;
It worked and get no error. What happend here? and how can i fix that?
Here is my github code link
https://github.com/thinhredbull1/mms/tree/main