I've been working on my project using the ESP32 board.
I am using millis() for my stop watch, however I can't reset the millis(). I am using this program to reset the millis():
===========================================================================
extern volatile unsigned long timer0_millis;
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
noInterrupts();
timer0_millis = 0;
interrupts();
}
And I always encounter this type of error:
C:\Users\User2\AppData\Local\Temp\arduino_build_487553\sketch\esp32.ino.cpp.o:(.literal._Z4loopv+0x4): undefined reference to `timer0_millis'
collect2.exe: error: ld returned 1 exit status
I've been working on my project using the ESP32 board. I am using millis() for my stop watch, however I can't reset the millis(). I am using this program to reset the millis():
=========================================================================== extern volatile unsigned long timer0_millis; void setup() { // put your setup code here, to run once:
}
void loop() { // put your main code here, to run repeatedly: noInterrupts(); timer0_millis = 0; interrupts(); }
And I always encounter this type of error:
C:\Users\User2\AppData\Local\Temp\arduino_build_487553\sketch\esp32.ino.cpp.o:(.literal._Z4loopv+0x4): undefined reference to `timer0_millis' collect2.exe: error: ld returned 1 exit status
please help me with this problem.