Encapsulate the drawing of the screen into Screens classes.

This commit is contained in:
JF
2020-01-18 18:17:52 +01:00
parent f14ba4a7e3
commit f049f382f0
16 changed files with 303 additions and 152 deletions

View File

@@ -19,6 +19,8 @@ namespace Pinetime {
uint8_t Hours() const { return hour; }
uint8_t Minutes() const { return minute; }
uint8_t Seconds() const { return second; }
std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds> CurrentDateTime() const { return currentDateTime; }
private:
uint16_t year = 0;
Months month = Months::Unknown;

View File

@@ -4,6 +4,9 @@
using namespace Pinetime::Components;
Gfx::Gfx(Pinetime::Drivers::St7789 &lcd) : lcd{lcd} {
}
void Gfx::Init() {
lcd.Init();
}

View File

@@ -11,6 +11,7 @@ namespace Pinetime {
class Gfx {
public:
explicit Gfx(Drivers::St7789& lcd);
void Init();
void ClearScreen();
void DrawString(uint8_t x, uint8_t y, uint16_t color, const char* text, const FONT_INFO *p_font, bool wrap);
void DrawChar(const FONT_INFO *font, uint8_t c, uint8_t *x, uint8_t y, uint16_t color);