Disable SPI, I²C, touch controller and display controller in sleep mode.
Re-enable them on wake up. Remove delays that were not needed in st7889 driver. Hopefully, it'll improve the battery life!
This commit is contained in:
@@ -85,4 +85,12 @@ void Gfx::pixel_draw(uint8_t x, uint8_t y, uint16_t color) {
|
||||
lcd.DrawPixel(x, y, color);
|
||||
}
|
||||
|
||||
void Gfx::Sleep() {
|
||||
lcd.Sleep();
|
||||
}
|
||||
|
||||
void Gfx::Wakeup() {
|
||||
lcd.Wakeup();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -16,6 +16,9 @@ namespace Pinetime {
|
||||
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 Sleep();
|
||||
void Wakeup();
|
||||
|
||||
private:
|
||||
Drivers::St7789& lcd;
|
||||
const uint8_t width = 240;
|
||||
|
Reference in New Issue
Block a user