Skip to content

Commit 1bfffc5

Browse files
committed
fix(sh8601): work again with idf v6.0
1 parent 4bf90fb commit 1bfffc5

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

components/display/lcd/esp_lcd_sh8601/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.0.0"
1+
version: "1.0.1"
22
description: ESP LCD SH8601(SPI & QSPI)
33
url: https://github.com/espressif/esp-iot-solution/tree/master/components/display/lcd/esp_lcd_sh8601
44
repository: https://github.com/espressif/esp-iot-solution.git

components/display/lcd/esp_lcd_sh8601/include/esp_lcd_sh8601.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#pragma once
88

99
#include <stdint.h>
10-
10+
#include "esp_idf_version.h"
1111
#include "esp_lcd_panel_vendor.h"
1212

1313
#ifdef __cplusplus
@@ -76,6 +76,7 @@ esp_err_t esp_lcd_new_panel_sh8601(const esp_lcd_panel_io_handle_t io, const esp
7676
.data2_io_num = d2, \
7777
.data3_io_num = d3, \
7878
.max_transfer_sz = max_trans_sz, \
79+
.flags = SPICOMMON_BUSFLAG_MASTER | SPICOMMON_BUSFLAG_QUAD, \
7980
}
8081

8182
/**
@@ -105,11 +106,18 @@ esp_err_t esp_lcd_new_panel_sh8601(const esp_lcd_panel_io_handle_t io, const esp
105106
.user_ctx = cb_ctx, \
106107
.lcd_cmd_bits = 32, \
107108
.lcd_param_bits = 8, \
108-
.flags = { \
109-
.quad_mode = true, \
110-
}, \
109+
/* Only set flags.quad_mode for ESP-IDF < v6.0.0 */ \
110+
_IF_IDF_LESS_THAN_6(.flags = { .quad_mode = true },) \
111111
}
112112

113+
#ifndef _IF_IDF_LESS_THAN_6
114+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)
115+
#define _IF_IDF_LESS_THAN_6(...) __VA_ARGS__
116+
#else
117+
#define _IF_IDF_LESS_THAN_6(...)
118+
#endif
119+
#endif
120+
113121
#ifdef __cplusplus
114122
}
115123
#endif

0 commit comments

Comments
 (0)