time in seconds doesn't need a special type

This commit is contained in:
Matthew Kennedy 2024-04-25 14:19:01 -07:00
parent 8d1029314a
commit b505b8ba0b
3 changed files with 2 additions and 6 deletions

View File

@ -38,10 +38,6 @@ using time_t = uint32_t;
#define STOICH_RATIO 14.7f #define STOICH_RATIO 14.7f
#define CONST_PI 3.14159265358979323846 #define CONST_PI 3.14159265358979323846
// time in seconds
using efitimesec_t = time_t;
/** /**
* We use a signed type here so that subtraction result is a proper negative value. * We use a signed type here so that subtraction result is a proper negative value.
* A typical use-case negative result is when we do 'timeNow() - timeOfEvent' where timeOfEvent * A typical use-case negative result is when we do 'timeNow() - timeOfEvent' where timeOfEvent

View File

@ -23,7 +23,7 @@ efitimeus_t getTimeNowUs() {
* Integer number of seconds since ECU boot. * Integer number of seconds since ECU boot.
* 31,710 years - would not overflow during our life span. * 31,710 years - would not overflow during our life span.
*/ */
efitimesec_t getTimeNowS(void) { int64_t getTimeNowS() {
return getTimeNowUs() / US_PER_SECOND; return getTimeNowUs() / US_PER_SECOND;
} }

View File

@ -108,6 +108,6 @@ efitimeus_t getTimeNowUs();
/** /**
* @brief Current system time in seconds. * @brief Current system time in seconds.
*/ */
efitimesec_t getTimeNowS(); int64_t getTimeNowS();
#endif /* __cplusplus */ #endif /* __cplusplus */