Overflow in currentTimeMillis and getTimeNowSeconds #3531
This commit is contained in:
parent
46e9269982
commit
80cf7b5ecd
|
@ -171,9 +171,12 @@ efitimems_t currentTimeMillis(void) {
|
||||||
return US2MS(getTimeNowUs());
|
return US2MS(getTimeNowUs());
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: this overflows pretty fast!
|
/**
|
||||||
|
* Integer number of seconds since ECU boot.
|
||||||
|
* 31,710 years - would not overflow during our life span.
|
||||||
|
*/
|
||||||
efitimesec_t getTimeNowSeconds(void) {
|
efitimesec_t getTimeNowSeconds(void) {
|
||||||
return currentTimeMillis() / 1000;
|
return getTimeNowUs() / US_PER_SECOND;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void resetAccel(void) {
|
static void resetAccel(void) {
|
||||||
|
|
Loading…
Reference in New Issue