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:
@@ -26,6 +26,7 @@
|
||||
#include "DisplayDriver.h"
|
||||
#include "ReturnCode.h"
|
||||
#include "Task.h"
|
||||
#include "RtcDriver.h"
|
||||
|
||||
class DisplayTimeTask : public Common::Schedule::Task {
|
||||
public:
|
||||
@@ -36,6 +37,14 @@ public:
|
||||
Common::Schedule::NextTime execute();
|
||||
|
||||
private:
|
||||
|
||||
void display_time();
|
||||
void display_number(uint32_t x, uint32_t y, uint32_t tens, uint32_t ones, const font &f);
|
||||
|
||||
BSP::DisplayDriver &m_driver;
|
||||
unsigned int m_y_pos;
|
||||
bool m_has_cleared;
|
||||
BSP::time_bcd m_last_time;
|
||||
|
||||
const bool m_display_seconds;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user