Skip to content

Commit 0e8efec

Browse files
committed
Merge branch 'bugfix/fix_shared_pointer_incorrect_delete' into 'master'
fix(lcd): use 'delete[]' instead of 'delete' for C array shared pointer Closes #143 See merge request ae_group/ESP32_Display_Panel!6
2 parents f9ed184 + bcbeb68 commit 0e8efec

8 files changed

+45
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# ChangeLog
22

3+
## v0.2.2 - 2024-12-23
4+
5+
### Bugfixes:
6+
7+
* fix(lcd): use 'delete[]' instead of 'delete' for C array shared pointer @FranciscoMoya (#142)
8+
* fix(Kconfig): fix build error on esp-idf and incorrect descriptions @Cathgao (#133)
9+
310
## v0.2.1 - 2024-11-14
411

512
### Enhancements:

Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
menu "ESP Display Panel Configurations"
22
config ESP_PANEL_CONF_FILE_SKIP
3-
bool "Unckeck this to ignore `ESP_Panel_Conf.h`"
3+
bool "Unckeck this to use `ESP_Panel_Conf.h`"
44
default y
55

66
config ESP_PANEL_BOARD_FILE_SKIP
7-
bool "Unckeck this to ignore `ESP_Panel_Board_*.h`"
7+
bool "Unckeck this to use `ESP_Panel_Board_*.h`"
88
default y
99

1010
config ESP_PANEL_CHECK_RESULT_ASSERT

idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "0.2.1"
1+
version: "0.2.2"
22
description: ESP32_Display_Panel is a library designed for ESP SoCs to drive display panels and facilitate rapid GUI development.
33
url: https://github.com/esp-arduino-libs/ESP32_Display_Panel
44
repository: https://github.com/esp-arduino-libs/ESP32_Display_Panel.git

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP32_Display_Panel
2-
version=0.2.1
2+
version=0.2.2
33
author=espressif
44
maintainer=espressif
55
sentence=ESP32_Display_Panel is a library designed for ESP SoCs to drive display panels and facilitate rapid GUI development.

src/ESP_PanelVersions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/* Library Version */
1212
#define ESP_PANEL_VERSION_MAJOR 0
1313
#define ESP_PANEL_VERSION_MINOR 2
14-
#define ESP_PANEL_VERSION_PATCH 1
14+
#define ESP_PANEL_VERSION_PATCH 2
1515

1616
/* File `ESP_Panel_Conf.h` */
1717
#define ESP_PANEL_CONF_VERSION_MAJOR 0

src/ESP_Panel_Board_Kconfig.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,13 @@
480480
#define ESP_PANEL_LCD_3WIRE_SPI_SDA_USE_EXPNADER 0
481481
#endif
482482
#endif
483+
#ifndef ESP_PANEL_LCD_3WIRE_SPI_SCL_ACTIVE_EDGE
484+
#ifdef CONfIGESP_PANEL_LCD_3WIRE_SPI_SCL_ACTIVE_EDGE
485+
#define ESP_PANEL_LCD_3WIRE_SPI_SCL_ACTIVE_EDGE CONFIG_ESP_PANEL_LCD_3WIRE_SPI_SCL_ACTIVE_EDGE
486+
#else
487+
#define ESP_PANEL_LCD_3WIRE_SPI_SCL_ACTIVE_EDGE 0
488+
#endif
489+
#endif
483490
#ifndef ESP_PANEL_LCD_FLAGS_AUTO_DEL_PANEL_IO
484491
#ifdef CONFIG_ESP_PANEL_LCD_FLAGS_AUTO_DEL_PANEL_IO
485492
#define ESP_PANEL_LCD_FLAGS_AUTO_DEL_PANEL_IO CONFIG_ESP_PANEL_LCD_FLAGS_AUTO_DEL_PANEL_IO
@@ -587,6 +594,13 @@
587594
#error "Missing configuration: ESP_PANEL_LCD_RGB_PIXEL_BITS"
588595
#endif
589596
#endif
597+
#ifndef ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE
598+
#ifdef CONFIG_ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE
599+
#define ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE CONFIG_ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE
600+
#else
601+
#define ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE 0
602+
#endif
603+
#endif
590604
#ifndef ESP_PANEL_LCD_RGB_IO_HSYNC
591605
#ifdef CONFIG_ESP_PANEL_LCD_RGB_IO_HSYNC
592606
#define ESP_PANEL_LCD_RGB_IO_HSYNC CONFIG_ESP_PANEL_LCD_RGB_IO_HSYNC
@@ -1042,6 +1056,13 @@
10421056
#define ESP_PANEL_BACKLIGHT_IDLE_OFF 0
10431057
#endif
10441058
#endif
1059+
#ifndef ESP_PANEL_LCD_BL_USE_PWM
1060+
#ifdef CONFIG_ESP_PANEL_LCD_BL_USE_PWM
1061+
#define ESP_PANEL_LCD_BL_USE_PWM CONFIG_ESP_PANEL_LCD_BL_USE_PWM
1062+
#else
1063+
#define ESP_PANEL_LCD_BL_USE_PWM 0
1064+
#endif
1065+
#endif
10451066
#endif /* ESP_PANEL_USE_BACKLIGHT */
10461067

10471068
// IO Expander

src/board/Kconfig.board_custom

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,12 @@ menu "LCD settings"
242242
bool "Use IO expander to control SDA"
243243
default n
244244

245+
config ESP_PANEL_LCD_3WIRE_SPI_SCL_ACTIVE_EDGE
246+
bool "SCL active falling edge"
247+
default n
248+
help
249+
If set to 1, the SCL signal will be active on the falling edge; otherwise, it will be active on the raising edge.
250+
245251
config ESP_PANEL_LCD_FLAGS_AUTO_DEL_PANEL_IO
246252
bool "Auto delete panel IO instance"
247253
default n
@@ -334,6 +340,11 @@ menu "LCD settings"
334340
default 24 if ESP_PANEL_LCD_RGB_DATA_WIDTH_8
335341
default 16 if ESP_PANEL_LCD_RGB_DATA_WIDTH_16
336342

343+
config ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE
344+
int "Bounce buffer size (bytes)"
345+
default 0
346+
range 0 10000000
347+
337348
menu "Pins"
338349
config ESP_PANEL_LCD_RGB_IO_HSYNC
339350
int "HSYNC"

src/lcd/ESP_PanelLcd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ bool ESP_PanelLcd::colorBarTest(uint16_t width, uint16_t height)
484484
int res_line_count = 0;
485485

486486
/* Malloc memory for a single color bar */
487-
shared_ptr<uint8_t> single_bar_buf(new uint8_t[row_per_bar * width * bytes_per_piexl]);
487+
shared_ptr<uint8_t> single_bar_buf(new uint8_t[row_per_bar * width * bytes_per_piexl], [](uint8_t* ptr) { delete[] ptr; });
488488
ESP_PANEL_CHECK_FALSE_RET(single_bar_buf != nullptr, false, "Malloc color buffer failed");
489489

490490
/* Draw color bar from top left to bottom right, the order is B - G - R */

0 commit comments

Comments
 (0)