Skip to content

Commit 1bb1260

Browse files
Update to ESP-IDF v5.4 and fix warnings (#193)
- Update to ESP-IDF v5.4 - Fixed a lot of new and existing warnings - Fix issue with incorrect `EventFlag` usage in Dispatcher
1 parent fa54eaa commit 1bb1260

File tree

24 files changed

+67
-175
lines changed

24 files changed

+67
-175
lines changed

.github/actions/build-firmware/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ runs:
2020
- name: 'Build'
2121
uses: espressif/esp-idf-ci-action@main
2222
with:
23-
esp_idf_version: v5.3.2
23+
esp_idf_version: v5.4
2424
target: ${{ inputs.arch }}
2525
path: './'
2626
- name: 'Release'

.github/actions/build-sdk/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ runs:
2020
- name: 'Build'
2121
uses: espressif/esp-idf-ci-action@main
2222
with:
23-
esp_idf_version: v5.3.2
23+
esp_idf_version: v5.4
2424
target: ${{ inputs.arch }}
2525
path: './'
2626
- name: 'Release'

App/idf_component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ dependencies:
1111
version: "1.5.0"
1212
rules:
1313
- if: "target == esp32s3"
14-
idf: '5.3.2'
14+
idf: '5.4'

Boards/CYD-2432S024C/Source/hal/YellowDisplay.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ static bool setBacklight(uint8_t duty) {
4444
.timer_sel = TWODOTFOUR_LCD_BACKLIGHT_LEDC_TIMER,
4545
.duty = duty,
4646
.hpoint = 0,
47+
.sleep_mode = LEDC_SLEEP_MODE_NO_ALIVE_NO_PD,
4748
.flags = {
4849
.output_invert = false
4950
}

Boards/LilygoTdeck/Source/InitHardware.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ static bool init_spi() {
3131
.data5_io_num = 0,
3232
.data6_io_num = 0,
3333
.data7_io_num = 0,
34+
.data_io_default_level = false,
3435
.max_transfer_sz = TDECK_SPI_TRANSFER_SIZE_LIMIT,
3536
.flags = 0,
3637
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,

Boards/LilygoTdeck/Source/hal/TdeckDisplay.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ static bool setBacklight(uint8_t duty) {
4545
.timer_sel = TDECK_LCD_BACKLIGHT_LEDC_TIMER,
4646
.duty = duty,
4747
.hpoint = 0,
48+
.sleep_mode = LEDC_SLEEP_MODE_NO_ALIVE_NO_PD,
4849
.flags = {
4950
.output_invert = 0
5051
}
@@ -68,6 +69,8 @@ bool TdeckDisplay::start() {
6869
.user_ctx = nullptr,
6970
.lcd_cmd_bits = 8,
7071
.lcd_param_bits = 8,
72+
.cs_ena_pretrans = 0,
73+
.cs_ena_posttrans = 0,
7174
.flags = {
7275
.dc_high_on_cmd = 0,
7376
.dc_low_on_data = 0,
@@ -134,6 +137,7 @@ bool TdeckDisplay::start() {
134137
const lvgl_port_display_cfg_t disp_cfg = {
135138
.io_handle = ioHandle,
136139
.panel_handle = panelHandle,
140+
.control_handle = nullptr,
137141
.buffer_size = TDECK_LCD_HORIZONTAL_RESOLUTION * TDECK_LCD_DRAW_BUFFER_HEIGHT * (TDECK_LCD_BITS_PER_PIXEL / 8),
138142
.double_buffer = true, // Disable to free up SPIRAM
139143
.trans_size = 0,
@@ -145,12 +149,15 @@ bool TdeckDisplay::start() {
145149
.mirror_x = true,
146150
.mirror_y = false,
147151
},
152+
.color_format = LV_COLOR_FORMAT_RGB565,
148153
.flags = {
149154
.buff_dma = false,
150155
.buff_spiram = true,
151156
.sw_rotate = false,
152-
.swap_bytes = false
153-
},
157+
.swap_bytes = false,
158+
.full_refresh = false,
159+
.direct_mode = false
160+
}
154161
};
155162

156163
displayHandle = lvgl_port_add_disp(&disp_cfg);

Boards/M5stackCore2/Source/InitBoot.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <driver/i2c.h>
22
#include <driver/spi_master.h>
3-
#include <intr_types.h>
3+
#include <esp_intr_types.h>
44
#include "Log.h"
55
#include "hal/Core2DisplayConstants.h"
66
#include "axp192/axp192.h"
@@ -37,7 +37,7 @@ static bool initSpi2() {
3737
.data7_io_num = GPIO_NUM_NC,
3838
.max_transfer_sz = CORE2_LCD_DRAW_BUFFER_SIZE,
3939
.flags = 0,
40-
.isr_cpu_id = INTR_CPU_ID_AUTO,
40+
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
4141
.intr_flags = 0
4242
};
4343

Boards/M5stackCoreS3/Source/InitBoot.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <driver/i2c.h>
22
#include <driver/spi_master.h>
3-
#include <intr_types.h>
3+
#include <esp_intr_types.h>
44
#include "Log.h"
55
#include "hal/CoreS3DisplayConstants.h"
66
#include "kernel/Kernel.h"
@@ -28,9 +28,10 @@ static bool initSpi3() {
2828
.data5_io_num = GPIO_NUM_NC,
2929
.data6_io_num = GPIO_NUM_NC,
3030
.data7_io_num = GPIO_NUM_NC,
31+
.data_io_default_level = false,
3132
.max_transfer_sz = CORES3_LCD_DRAW_BUFFER_SIZE,
3233
.flags = 0,
33-
.isr_cpu_id = INTR_CPU_ID_AUTO,
34+
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
3435
.intr_flags = 0
3536
};
3637

Boards/M5stackCoreS3/Source/hal/CoreS3Display.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ bool CoreS3Display::start() {
2929
.user_ctx = nullptr,
3030
.lcd_cmd_bits = 8,
3131
.lcd_param_bits = 8,
32+
.cs_ena_pretrans = 0,
33+
.cs_ena_posttrans = 0,
3234
.flags = {
3335
.dc_high_on_cmd = 0,
3436
.dc_low_on_data = 0,

Boards/UnPhone/Source/InitHardware.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static bool initSpi() {
2727
.data5_io_num = 0,
2828
.data6_io_num = 0,
2929
.data7_io_num = 0,
30+
.data_io_default_level = false,
3031
.max_transfer_sz = UNPHONE_SPI_TRANSFER_SIZE_LIMIT,
3132
.flags = 0,
3233
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,

Boards/UnPhone/Source/hx8357/disp_spi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
/**********************
8888
* STATIC PROTOTYPES
8989
**********************/
90-
static void IRAM_ATTR spi_ready (spi_transaction_t *trans);
90+
static void spi_ready(spi_transaction_t*trans);
9191

9292
/**********************
9393
* STATIC VARIABLES

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ If you implemented a board yourself, I'm willing to refer to your implementation
4040

4141
### Anything that doesn't fall in the above categories?
4242

43-
Please [contact me](https://tactility.one/#/support)a me first!
43+
Please [contact me](https://tactility.one/#/support) me first!
4444

4545
## Pull Requests
4646

Libraries/QRCode/src/qrcode.c

+1-11
Original file line numberDiff line numberDiff line change
@@ -848,20 +848,10 @@ int8_t qrcode_initText(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_
848848
}
849849

850850
bool qrcode_getModule(QRCode *qrcode, uint8_t x, uint8_t y) {
851-
if (x < 0 || x >= qrcode->size || y < 0 || y >= qrcode->size) {
851+
if (x >= qrcode->size || y >= qrcode->size) {
852852
return false;
853853
}
854854

855855
uint32_t offset = y * qrcode->size + x;
856856
return (qrcode->modules[offset >> 3] & (1 << (7 - (offset & 0x07)))) != 0;
857857
}
858-
859-
/*
860-
uint8_t qrcode_getHexLength(QRCode *qrcode) {
861-
return ((qrcode->size * qrcode->size) + 7) / 4;
862-
}
863-
864-
void qrcode_getHex(QRCode *qrcode, char *result) {
865-
866-
}
867-
*/

Tactility/Source/app/AppCompatC.h

-109
This file was deleted.

Tactility/Source/app/ElfApp.cpp

+14-13
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "service/loader/Loader.h"
1010

1111
#include <string>
12+
#include <utility>
1213

1314
namespace tt::app {
1415

@@ -19,13 +20,13 @@ struct ElfManifest {
1920
std::string name;
2021
/** Optional icon. */
2122
std::string icon;
22-
CreateData _Nullable createData;
23-
DestroyData _Nullable destroyData;
24-
OnStart _Nullable onStart;
25-
OnStop _Nullable onStop;
26-
OnShow _Nullable onShow;
27-
OnHide _Nullable onHide;
28-
OnResult _Nullable onResult;
23+
CreateData _Nullable createData = nullptr;
24+
DestroyData _Nullable destroyData = nullptr;
25+
OnStart _Nullable onStart = nullptr;
26+
OnStop _Nullable onStop = nullptr;
27+
OnShow _Nullable onShow = nullptr;
28+
OnHide _Nullable onHide = nullptr;
29+
OnResult _Nullable onResult = nullptr;
2930
};
3031

3132
static size_t elfManifestSetCount = 0;
@@ -88,7 +89,7 @@ class ElfApp : public App {
8889

8990
public:
9091

91-
explicit ElfApp(const std::string& filePath) : filePath(filePath) {}
92+
explicit ElfApp(std::string filePath) : filePath(std::move(filePath)) {}
9293

9394
void onStart(AppContext& appContext) override {
9495
auto initial_count = elfManifestSetCount;
@@ -101,7 +102,7 @@ class ElfApp : public App {
101102
}
102103

103104
if (manifest->onStart != nullptr) {
104-
manifest->onStart(appContext, data);
105+
manifest->onStart(&appContext, data);
105106
}
106107
}
107108
} else {
@@ -113,7 +114,7 @@ class ElfApp : public App {
113114
TT_LOG_I(TAG, "Cleaning up app");
114115
if (manifest != nullptr) {
115116
if (manifest->onStop != nullptr) {
116-
manifest->onStop(appContext, data);
117+
manifest->onStop(&appContext, data);
117118
}
118119

119120
if (manifest->destroyData != nullptr && data != nullptr) {
@@ -127,19 +128,19 @@ class ElfApp : public App {
127128

128129
void onShow(AppContext& appContext, lv_obj_t* parent) override {
129130
if (manifest != nullptr && manifest->onShow != nullptr) {
130-
manifest->onShow(appContext, data, parent);
131+
manifest->onShow(&appContext, data, parent);
131132
}
132133
}
133134

134135
void onHide(AppContext& appContext) override {
135136
if (manifest != nullptr && manifest->onHide != nullptr) {
136-
manifest->onHide(appContext, data);
137+
manifest->onHide(&appContext, data);
137138
}
138139
}
139140

140141
void onResult(AppContext& appContext, Result result, std::unique_ptr<Bundle> resultBundle) override {
141142
if (manifest != nullptr && manifest->onResult != nullptr) {
142-
manifest->onResult(appContext, data, result, std::move(resultBundle));
143+
manifest->onResult(&appContext, data, result, resultBundle.get());
143144
}
144145
}
145146
};

Tactility/Source/app/ElfApp.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
#pragma once
22

3-
#include "AppCompatC.h"
43
#include "AppManifest.h"
54

65
#ifdef ESP_PLATFORM
76

87
namespace tt::app {
98

9+
typedef void* (*CreateData)();
10+
typedef void (*DestroyData)(void* data);
11+
typedef void (*OnStart)(void* appContext, void* _Nullable data);
12+
typedef void (*OnStop)(void* appContext, void* _Nullable data);
13+
typedef void (*OnShow)(void* appContext, void* _Nullable data, lv_obj_t* parent);
14+
typedef void (*OnHide)(void* appContext, void* _Nullable data);
15+
typedef void (*OnResult)(void* appContext, void* _Nullable data, Result result, Bundle* resultData);
16+
1017
void setElfAppManifest(
1118
const char* name,
1219
const char* _Nullable icon,

Tactility/Source/app/power/Power.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace tt::app::power {
1313
#define TAG "power"
1414

1515
extern const AppManifest manifest;
16-
static void onTimer(TT_UNUSED std::shared_ptr<void> context);
1716

1817
class PowerApp;
1918

0 commit comments

Comments
 (0)