Skip to content

Commit f259cd6

Browse files
leonardocavagnisfacchinm
authored andcommitted
fix problem of include lvgl when using primitive function in H7_Video lib
1 parent a7926cf commit f259cd6

File tree

5 files changed

+9
-273
lines changed

5 files changed

+9
-273
lines changed

libraries/H7_Video/src/H7_Video.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ int H7_Video::begin(bool landscape) {
5151
stm32_LCD_Clear(0);
5252

5353
#if __has_include("lvgl.h")
54-
_currFrameBufferAddr = getNextFrameBuffer();
54+
getNextFrameBuffer();
5555

5656
/* Initiliaze LVGL library */
5757
lv_init();
@@ -74,8 +74,6 @@ int H7_Video::begin(bool landscape) {
7474
lv_disp_drv_register(&disp_drv); /* Finally register the driver */
7575
#endif
7676

77-
_currFrameBufferAddr = getCurrentFrameBuffer();
78-
7977
return 1;
8078
}
8179

@@ -86,13 +84,17 @@ void H7_Video::end() {
8684
void H7_Video::beginDraw() {
8785
ArduinoGraphics::beginDraw();
8886

87+
#if __has_include("lvgl.h")
88+
getNextFrameBuffer();
89+
#endif
90+
8991
stm32_LCD_Clear(0);
9092
}
9193

9294
void H7_Video::endDraw() {
9395
ArduinoGraphics::endDraw();
9496

95-
_currFrameBufferAddr = getNextFrameBuffer();
97+
getNextFrameBuffer();
9698
}
9799

98100
void H7_Video::clear(){
@@ -112,7 +114,7 @@ void H7_Video::set(int x, int y, uint8_t r, uint8_t g, uint8_t b) {
112114
}
113115

114116
uint32_t color = (uint32_t)((uint32_t)(r << 16) | (uint32_t)(g << 8) | (uint32_t)(b << 0));
115-
stm32_LCD_FillArea((void *)(_currFrameBufferAddr + ((x_rot + (width() * y_rot)) * sizeof(uint16_t))), 1, 1, color);
117+
stm32_LCD_FillArea((void *)(getCurrentFrameBuffer() + ((x_rot + (width() * y_rot)) * sizeof(uint16_t))), 1, 1, color);
116118
}
117119

118120
#if __has_include("lvgl.h")

libraries/H7_Video/src/H7_Video.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class H7_Video : public ArduinoGraphics {
3131
private:
3232
DisplayShieldModel _shield;
3333
bool _landscape;
34-
uint32_t _currFrameBufferAddr;
3534
};
3635

3736
#endif /* _H7_VIDEO_H */

libraries/H7_Video/src/anx7625.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <drivers/DigitalOut.h>
1818
#include <drivers/DigitalInOut.h>
1919
#include <dsi.h>
20-
#include <string.h>
20+
//#include <string.h>
2121
#include <drivers/I2C.h>
2222

2323
#ifdef TARGET_PORTENTA_H7

libraries/H7_Video/src/dsi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include <Arduino.h>
1717
#include <anx7625.h>
18-
#include "stm32h7xx_hal.h"
18+
//#include "stm32h7xx_hal.h"
1919
#include "dsi.h"
2020
#include "SDRAM.h"
2121

libraries/H7_Video/src/glcdfont.c

Lines changed: 0 additions & 265 deletions
This file was deleted.

0 commit comments

Comments
 (0)