Huge refactoring for C++ and low-power mode
The display currently shows the time, with hours and minutes, and is capable of receiving input with buttons (though does nothing). It sleeps during intervals where nothing is happening. The display task runs once per second, and RTC alarm A is used for periodic alarms to update the system time.
This commit is contained in:
20
Time.h
20
Time.h
@@ -57,6 +57,26 @@ public:
|
||||
{
|
||||
return value * MICROS_PER_SEC;
|
||||
}
|
||||
|
||||
static inline uint64_t to_nanos(time_t value)
|
||||
{
|
||||
return value * NANOS_PER_MICRO;
|
||||
}
|
||||
|
||||
static inline uint64_t to_micros(time_t value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
static inline uint64_t to_millis(time_t value)
|
||||
{
|
||||
return value / MICROS_PER_MILLI;
|
||||
}
|
||||
|
||||
static inline uint64_t to_seconds(time_t value)
|
||||
{
|
||||
return value / MICROS_PER_SEC;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user