I'm trying to declare 2 volatile bytes to run as part of ISR for 2 separate hall effect sensors to measure and calculate RPM as follows:
volatile byte half_revolutions;
unsigned int rpm;
unsigned long timeold;
volatile byte half_revolutions2;
unsigned int rpm2;
unsigned long timeold2;
As soon as I compile this and the rest of the program, I get the following error text in IDE 1.8.9:
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp: In member function 'availableForWrite':
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp:203:1: internal compiler error: Segmentation fault
}
^
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
lto-wrapper.exe: fatal error: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status
compilation terminated.
c:/program files/windowsapps/arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for "Adafruit_MMA8451.h"
Used: C:\Users\AS9763\Documents\Arduino\libraries\Adafruit_MMA8451
Not used: C:\Users\AS9763\Documents\Arduino\libraries\Adafruit_MMA8451_Library-master
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
If I remove the "volatile byte half_revolutions2;" line, the error goes away.
Any suggestions would be appreciated as I'm still quite new to this!
thanks