Add support for hardware assisted vertical scrolling.

This commit is contained in:
JF
2020-02-15 15:12:29 +01:00
parent e737fb0499
commit f30573a9b0
4 changed files with 34 additions and 1 deletions

View File

@@ -30,7 +30,7 @@ void Gfx::ClearScreen() {
void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint16_t color) {
SetBackgroundColor(color);
state.remainingIterations = 240 + 1;
state.remainingIterations = h;
state.currentIteration = 0;
state.busy = true;
state.action = Action::FillRectangle;
@@ -183,4 +183,11 @@ void Gfx::WaitTransfertFinished() const {
ulTaskNotifyTake(pdTRUE, 500);
}
void Gfx::SetScrollArea(uint16_t topFixedLines, uint16_t scrollLines, uint16_t bottomFixedLines) {
lcd.VerticalScrollDefinition(topFixedLines, scrollLines, bottomFixedLines);
}
void Gfx::SetScrollStartLine(uint16_t line) {
lcd.VerticalScrollStartAddress(line);
}

View File

@@ -19,6 +19,9 @@ namespace Pinetime {
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);
void FillRectangle(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t color);
void SetScrollArea(uint16_t topFixedLines, uint16_t scrollLines, uint16_t bottomFixedLines);
void SetScrollStartLine(uint16_t line);
void Sleep();
void Wakeup();