the vtimer almost always overflows during the calculation in the micros() function, because the calculation is done with unsigned / 16-bit precision and then the result is converted to unsigned long / 32-bit precision.
Overflow also occurs in the millis() function after ~65 seconds.
Both can be easily fixed by using unsigned long instead of unsigned for vtimer.
Hello,
the vtimer almost always overflows during the calculation in the micros() function, because the calculation is done with unsigned / 16-bit precision and then the result is converted to unsigned long / 32-bit precision. Overflow also occurs in the millis() function after ~65 seconds. Both can be easily fixed by using unsigned long instead of unsigned for vtimer.
Best regards