Skip to content

Commit

Permalink
Update to ESP-IDF v5.4 and fix warnings (#193)
Browse files Browse the repository at this point in the history
- Update to ESP-IDF v5.4
- Fixed a lot of new and existing warnings
- Fix issue with incorrect `EventFlag` usage in Dispatcher
  • Loading branch information
KenVanHoeylandt authored Jan 26, 2025
1 parent fa54eaa commit 1bb1260
Show file tree
Hide file tree
Showing 24 changed files with 67 additions and 175 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-firmware/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
- name: 'Build'
uses: espressif/esp-idf-ci-action@main
with:
esp_idf_version: v5.3.2
esp_idf_version: v5.4
target: ${{ inputs.arch }}
path: './'
- name: 'Release'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-sdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
- name: 'Build'
uses: espressif/esp-idf-ci-action@main
with:
esp_idf_version: v5.3.2
esp_idf_version: v5.4
target: ${{ inputs.arch }}
path: './'
- name: 'Release'
Expand Down
2 changes: 1 addition & 1 deletion App/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ dependencies:
version: "1.5.0"
rules:
- if: "target == esp32s3"
idf: '5.3.2'
idf: '5.4'
1 change: 1 addition & 0 deletions Boards/CYD-2432S024C/Source/hal/YellowDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static bool setBacklight(uint8_t duty) {
.timer_sel = TWODOTFOUR_LCD_BACKLIGHT_LEDC_TIMER,
.duty = duty,
.hpoint = 0,
.sleep_mode = LEDC_SLEEP_MODE_NO_ALIVE_NO_PD,
.flags = {
.output_invert = false
}
Expand Down
1 change: 1 addition & 0 deletions Boards/LilygoTdeck/Source/InitHardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ static bool init_spi() {
.data5_io_num = 0,
.data6_io_num = 0,
.data7_io_num = 0,
.data_io_default_level = false,
.max_transfer_sz = TDECK_SPI_TRANSFER_SIZE_LIMIT,
.flags = 0,
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
Expand Down
11 changes: 9 additions & 2 deletions Boards/LilygoTdeck/Source/hal/TdeckDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static bool setBacklight(uint8_t duty) {
.timer_sel = TDECK_LCD_BACKLIGHT_LEDC_TIMER,
.duty = duty,
.hpoint = 0,
.sleep_mode = LEDC_SLEEP_MODE_NO_ALIVE_NO_PD,
.flags = {
.output_invert = 0
}
Expand All @@ -68,6 +69,8 @@ bool TdeckDisplay::start() {
.user_ctx = nullptr,
.lcd_cmd_bits = 8,
.lcd_param_bits = 8,
.cs_ena_pretrans = 0,
.cs_ena_posttrans = 0,
.flags = {
.dc_high_on_cmd = 0,
.dc_low_on_data = 0,
Expand Down Expand Up @@ -134,6 +137,7 @@ bool TdeckDisplay::start() {
const lvgl_port_display_cfg_t disp_cfg = {
.io_handle = ioHandle,
.panel_handle = panelHandle,
.control_handle = nullptr,
.buffer_size = TDECK_LCD_HORIZONTAL_RESOLUTION * TDECK_LCD_DRAW_BUFFER_HEIGHT * (TDECK_LCD_BITS_PER_PIXEL / 8),
.double_buffer = true, // Disable to free up SPIRAM
.trans_size = 0,
Expand All @@ -145,12 +149,15 @@ bool TdeckDisplay::start() {
.mirror_x = true,
.mirror_y = false,
},
.color_format = LV_COLOR_FORMAT_RGB565,
.flags = {
.buff_dma = false,
.buff_spiram = true,
.sw_rotate = false,
.swap_bytes = false
},
.swap_bytes = false,
.full_refresh = false,
.direct_mode = false
}
};

displayHandle = lvgl_port_add_disp(&disp_cfg);
Expand Down
4 changes: 2 additions & 2 deletions Boards/M5stackCore2/Source/InitBoot.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <driver/i2c.h>
#include <driver/spi_master.h>
#include <intr_types.h>
#include <esp_intr_types.h>
#include "Log.h"
#include "hal/Core2DisplayConstants.h"
#include "axp192/axp192.h"
Expand Down Expand Up @@ -37,7 +37,7 @@ static bool initSpi2() {
.data7_io_num = GPIO_NUM_NC,
.max_transfer_sz = CORE2_LCD_DRAW_BUFFER_SIZE,
.flags = 0,
.isr_cpu_id = INTR_CPU_ID_AUTO,
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
.intr_flags = 0
};

Expand Down
5 changes: 3 additions & 2 deletions Boards/M5stackCoreS3/Source/InitBoot.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <driver/i2c.h>
#include <driver/spi_master.h>
#include <intr_types.h>
#include <esp_intr_types.h>
#include "Log.h"
#include "hal/CoreS3DisplayConstants.h"
#include "kernel/Kernel.h"
Expand Down Expand Up @@ -28,9 +28,10 @@ static bool initSpi3() {
.data5_io_num = GPIO_NUM_NC,
.data6_io_num = GPIO_NUM_NC,
.data7_io_num = GPIO_NUM_NC,
.data_io_default_level = false,
.max_transfer_sz = CORES3_LCD_DRAW_BUFFER_SIZE,
.flags = 0,
.isr_cpu_id = INTR_CPU_ID_AUTO,
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
.intr_flags = 0
};

Expand Down
2 changes: 2 additions & 0 deletions Boards/M5stackCoreS3/Source/hal/CoreS3Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ bool CoreS3Display::start() {
.user_ctx = nullptr,
.lcd_cmd_bits = 8,
.lcd_param_bits = 8,
.cs_ena_pretrans = 0,
.cs_ena_posttrans = 0,
.flags = {
.dc_high_on_cmd = 0,
.dc_low_on_data = 0,
Expand Down
1 change: 1 addition & 0 deletions Boards/UnPhone/Source/InitHardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ static bool initSpi() {
.data5_io_num = 0,
.data6_io_num = 0,
.data7_io_num = 0,
.data_io_default_level = false,
.max_transfer_sz = UNPHONE_SPI_TRANSFER_SIZE_LIMIT,
.flags = 0,
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
Expand Down
2 changes: 1 addition & 1 deletion Boards/UnPhone/Source/hx8357/disp_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
/**********************
* STATIC PROTOTYPES
**********************/
static void IRAM_ATTR spi_ready (spi_transaction_t *trans);
static void spi_ready(spi_transaction_t*trans);

/**********************
* STATIC VARIABLES
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ If you implemented a board yourself, I'm willing to refer to your implementation

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

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

## Pull Requests

Expand Down
12 changes: 1 addition & 11 deletions Libraries/QRCode/src/qrcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,20 +848,10 @@ int8_t qrcode_initText(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_
}

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

uint32_t offset = y * qrcode->size + x;
return (qrcode->modules[offset >> 3] & (1 << (7 - (offset & 0x07)))) != 0;
}

/*
uint8_t qrcode_getHexLength(QRCode *qrcode) {
return ((qrcode->size * qrcode->size) + 7) / 4;
}
void qrcode_getHex(QRCode *qrcode, char *result) {
}
*/
109 changes: 0 additions & 109 deletions Tactility/Source/app/AppCompatC.h

This file was deleted.

27 changes: 14 additions & 13 deletions Tactility/Source/app/ElfApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "service/loader/Loader.h"

#include <string>
#include <utility>

namespace tt::app {

Expand All @@ -19,13 +20,13 @@ struct ElfManifest {
std::string name;
/** Optional icon. */
std::string icon;
CreateData _Nullable createData;
DestroyData _Nullable destroyData;
OnStart _Nullable onStart;
OnStop _Nullable onStop;
OnShow _Nullable onShow;
OnHide _Nullable onHide;
OnResult _Nullable onResult;
CreateData _Nullable createData = nullptr;
DestroyData _Nullable destroyData = nullptr;
OnStart _Nullable onStart = nullptr;
OnStop _Nullable onStop = nullptr;
OnShow _Nullable onShow = nullptr;
OnHide _Nullable onHide = nullptr;
OnResult _Nullable onResult = nullptr;
};

static size_t elfManifestSetCount = 0;
Expand Down Expand Up @@ -88,7 +89,7 @@ class ElfApp : public App {

public:

explicit ElfApp(const std::string& filePath) : filePath(filePath) {}
explicit ElfApp(std::string filePath) : filePath(std::move(filePath)) {}

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

if (manifest->onStart != nullptr) {
manifest->onStart(appContext, data);
manifest->onStart(&appContext, data);
}
}
} else {
Expand All @@ -113,7 +114,7 @@ class ElfApp : public App {
TT_LOG_I(TAG, "Cleaning up app");
if (manifest != nullptr) {
if (manifest->onStop != nullptr) {
manifest->onStop(appContext, data);
manifest->onStop(&appContext, data);
}

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

void onShow(AppContext& appContext, lv_obj_t* parent) override {
if (manifest != nullptr && manifest->onShow != nullptr) {
manifest->onShow(appContext, data, parent);
manifest->onShow(&appContext, data, parent);
}
}

void onHide(AppContext& appContext) override {
if (manifest != nullptr && manifest->onHide != nullptr) {
manifest->onHide(appContext, data);
manifest->onHide(&appContext, data);
}
}

void onResult(AppContext& appContext, Result result, std::unique_ptr<Bundle> resultBundle) override {
if (manifest != nullptr && manifest->onResult != nullptr) {
manifest->onResult(appContext, data, result, std::move(resultBundle));
manifest->onResult(&appContext, data, result, resultBundle.get());
}
}
};
Expand Down
9 changes: 8 additions & 1 deletion Tactility/Source/app/ElfApp.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#pragma once

#include "AppCompatC.h"
#include "AppManifest.h"

#ifdef ESP_PLATFORM

namespace tt::app {

typedef void* (*CreateData)();
typedef void (*DestroyData)(void* data);
typedef void (*OnStart)(void* appContext, void* _Nullable data);
typedef void (*OnStop)(void* appContext, void* _Nullable data);
typedef void (*OnShow)(void* appContext, void* _Nullable data, lv_obj_t* parent);
typedef void (*OnHide)(void* appContext, void* _Nullable data);
typedef void (*OnResult)(void* appContext, void* _Nullable data, Result result, Bundle* resultData);

void setElfAppManifest(
const char* name,
const char* _Nullable icon,
Expand Down
1 change: 0 additions & 1 deletion Tactility/Source/app/power/Power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace tt::app::power {
#define TAG "power"

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

class PowerApp;

Expand Down
Loading

0 comments on commit 1bb1260

Please sign in to comment.