Skip to content

Commit af959eb

Browse files
committed
update so gfx works
1 parent ae9ef1e commit af959eb

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/GigaDisplay.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@
2525
#include <zephyr/device.h>
2626
#include <zephyr/drivers/display.h>
2727

28-
2928
#if __has_include ("lvgl.h")
3029
#include "lvgl.h"
3130
#endif
3231

33-
/* Private function prototypes -----------------------------------------------*/
32+
3433
#if __has_include ("lvgl.h")
3534
#if __MBED__
3635
#include "mbed.h"
@@ -51,6 +50,7 @@ void lvgl_displayFlushing(lv_disp_drv_t * disp, const lv_area_t * area, lv_color
5150
#endif
5251
#endif
5352

53+
5454
#ifdef HAS_ARDUINOGRAPHICS
5555
Display::Display(int width, int height) : ArduinoGraphics(width, height), gdev(NULL)
5656
#else
@@ -188,7 +188,6 @@ bool Display::begin(DisplayPixelFormat pixformat) {
188188
textFont(Font_5x7);
189189
#endif //arduinoGraphics
190190

191-
192191
#if __has_include("lvgl.h")
193192
printk("initializing LVGL!!!!\n");
194193
/* Initiliaze LVGL library */
@@ -417,7 +416,7 @@ void lvgl_displayFlushing(lv_display_t * disp, const lv_area_t * area, unsigned
417416
uint32_t offsetPos = (area_in_use->x1 + (lcd_x_size * area_in_use->y1)) * sizeof(uint16_t);
418417
//dsi_lcdDrawImage((void *) px_map, (void *)(dsi_getActiveFrameBuffer() + offsetPos), w, h, DMA2D_INPUT_RGB565);
419418
//--- cant do this memcpy(px_map, buffer + offsetPos, w * h);
420-
Display::write8(0, 0, buffer);
419+
//Display::write8(0, 0, buffer);
421420
#endif
422421
lv_display_flush_ready(disp); /* Indicate you are ready with the flushing*/
423422
}
@@ -431,12 +430,13 @@ void lvgl_displayFlushing(lv_disp_drv_t * disp, const lv_area_t * area, lv_color
431430
dsi_lcdDrawImage((void *) color_p, (void *)(dsi_getActiveFrameBuffer() + offsetPos), width, height, DMA2D_INPUT_RGB565);
432431
#else
433432
//--- cant do this memcpy(px_map, buffer + offsetPos, w * h);
434-
Display::write8(0, 0, buffer);
433+
//Display::write8(0, 0, buffer);
435434

436435
#endif
437436
lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/
438437
}
439438
#endif
440-
#endif
439+
#endif //end lvgl
440+
441441

442442
#endif //__ZEPHYR__

src/GigaDisplay.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ class Display
161161
private:
162162
const struct device *gdev;
163163
struct display_buffer_descriptor *buf_desc;
164+
#if defined( HAS_ARDUINOGRAPHICS) || __has_include ("lvgl.h")
164165
uint16_t *buffer = nullptr;
165166
uint32_t sizeof_framebuffer;
167+
#endif
166168
protected:
167169
int16_t _height, _width;
168170
bool _rotated = false;

0 commit comments

Comments
 (0)