diff options
| author | ailurux <ailuruxx@gmail.com> | 2024-03-20 13:42:03 +1100 |
|---|---|---|
| committer | ailurux <ailuruxx@gmail.com> | 2024-03-20 13:42:03 +1100 |
| commit | 51dfb5b3e30caf823c2355ff957c01864f35f9f6 (patch) | |
| tree | 1f0e41397259c6e206aba136ad5070b9de30e1b1 /src/drivers/display.cpp | |
| parent | 170c23b832eed6dad2b118e50164464cc93e5c4c (diff) | |
| parent | a05d93a1e26181237a76da5ce398c6b08497d591 (diff) | |
| download | tangara-fw-51dfb5b3e30caf823c2355ff957c01864f35f9f6.tar.gz | |
Merge branch 'main' into themes
Diffstat (limited to 'src/drivers/display.cpp')
| -rw-r--r-- | src/drivers/display.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/drivers/display.cpp b/src/drivers/display.cpp index cb3ee3a0..c16fc148 100644 --- a/src/drivers/display.cpp +++ b/src/drivers/display.cpp @@ -39,9 +39,6 @@ [[maybe_unused]] static const char* kTag = "DISPLAY"; -// TODO(jacqueline): Encode width and height variations in the init data. -static const uint8_t kDisplayHeight = 128 + 2; -static const uint8_t kDisplayWidth = 160 + 1; static const uint8_t kTransactionQueueSize = 2; static const gpio_num_t kDisplayDr = GPIO_NUM_33; @@ -51,9 +48,11 @@ static const gpio_num_t kDisplayCs = GPIO_NUM_22; /* * The size of each of our two display buffers. This is fundamentally a balance * between performance and memory usage. LVGL docs recommend a buffer 1/10th the - * size of the screen is the best tradeoff + * size of the screen is the best tradeoff. + 8 + * The 160x128 is the nominal size of our standard faceplate's display. */ -static const int kDisplayBufferSize = kDisplayWidth * kDisplayHeight / 10; +static const int kDisplayBufferSize = 160 * 128 / 10; DMA_ATTR static lv_color_t kDisplayBuffer[kDisplayBufferSize]; namespace drivers { @@ -154,10 +153,8 @@ auto Display::Create(IGpios& expander, lv_disp_drv_init(&display->driver_); display->driver_.draw_buf = &display->buffers_; - display->driver_.hor_res = kDisplayWidth; - display->driver_.ver_res = kDisplayHeight; - // display->driver_.sw_rotate = 1; - // display->driver_.rotated = LV_DISP_ROT_270; + display->driver_.hor_res = init_data.width; + display->driver_.ver_res = init_data.height; display->driver_.sw_rotate = 0; display->driver_.rotated = LV_DISP_ROT_NONE; display->driver_.antialiasing = 0; |
