Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/apps/app_launcher/view/panel_dual_mic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class MicTestWindow : public ui::Window {
chart->setRange(LV_CHART_AXIS_PRIMARY_Y, -32768, 32767);
chart->setUpdateMode(LV_CHART_UPDATE_MODE_SHIFT);
chart->setBgOpa(LV_OPA_TRANSP, LV_PART_ITEMS);
chart->setBorderWidth(0, LV_PART_MAIN | LV_STATE_DEFAULT);
chart->setBorderWidth(0, static_cast<lv_style_selector_t>(LV_PART_MAIN) | static_cast<lv_style_selector_t>(LV_STATE_DEFAULT));
chart->setDivLineCount(0, 0);
chart->addSeries(lv_color_hex(0x40FFA1), LV_CHART_AXIS_PRIMARY_Y);
}
Expand Down
2 changes: 1 addition & 1 deletion app/apps/app_launcher/view/panel_headphone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class HeadphoneTestWindow : public ui::Window {
chart->setRange(LV_CHART_AXIS_PRIMARY_Y, -32768, 32767);
chart->setUpdateMode(LV_CHART_UPDATE_MODE_SHIFT);
chart->setBgOpa(LV_OPA_TRANSP, LV_PART_ITEMS);
chart->setBorderWidth(0, LV_PART_MAIN | LV_STATE_DEFAULT);
chart->setBorderWidth(0, static_cast<lv_style_selector_t>(LV_PART_MAIN) | static_cast<lv_style_selector_t>(LV_STATE_DEFAULT));
chart->setDivLineCount(0, 0);
chart->addSeries(lv_color_hex(0x40FFA1), LV_CHART_AXIS_PRIMARY_Y);
}
Expand Down
2 changes: 1 addition & 1 deletion app/apps/app_launcher/view/panel_music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class MusicTestWindow : public ui::Window {
chart->setRange(LV_CHART_AXIS_PRIMARY_Y, -32768, 32767);
chart->setUpdateMode(LV_CHART_UPDATE_MODE_SHIFT);
chart->setBgOpa(LV_OPA_TRANSP, LV_PART_ITEMS);
chart->setBorderWidth(0, LV_PART_MAIN | LV_STATE_DEFAULT);
chart->setBorderWidth(0, static_cast<lv_style_selector_t>(LV_PART_MAIN) | static_cast<lv_style_selector_t>(LV_STATE_DEFAULT));
chart->setDivLineCount(0, 0);
chart->addSeries(lv_color_hex(0x40FFA1), LV_CHART_AXIS_PRIMARY_Y);
}
Expand Down
23 changes: 23 additions & 0 deletions platforms/tab5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,26 @@ set(EXTRA_COMPONENT_DIRS
)

project(m5stack_tab5)

# LVGL declares hot functions with LV_ATTRIBUTE_FAST_MEM in both the header and
# the definition. On ESP-IDF the macro is IRAM_ATTR, which expands to
# `section(".iram1.<__COUNTER__>")`, so the declaration and the definition land
# in two differently-numbered sections of the same `.iram1` group. GCC 15 (which
# ships with IDF 6.x) reports that as -Wattributes, and IDF builds with -Werror.
# LVGL lives in the fetched `dependencies/` tree, so relax just this one warning
# for that one component instead of patching it.
idf_build_get_property(__tab5_build_components BUILD_COMPONENTS)
if("lvgl" IN_LIST __tab5_build_components)
idf_component_get_property(__tab5_lvgl_lib lvgl COMPONENT_LIB)
target_compile_options(${__tab5_lvgl_lib} PRIVATE "-Wno-error=attributes")
endif()

# IDF 6.x raises the C++ standard from gnu++2b to gnu++26 (GCC 15). In C++20,
# `[=]` no longer implicitly captures `this`; smooth_ui_toolkit's spring.cpp
# still does that, which is now -Wdeprecated caught by -Werror. Same reasoning
# as above: it is fetched into `dependencies/`, so relax the one warning for the
# one component rather than patching third-party sources.
if("smooth_ui_toolkit" IN_LIST __tab5_build_components)
idf_component_get_property(__tab5_sut_lib smooth_ui_toolkit COMPONENT_LIB)
target_compile_options(${__tab5_sut_lib} PRIVATE "-Wno-error=deprecated")
endif()
11 changes: 8 additions & 3 deletions platforms/tab5/components/esp_lcd_st7121/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
idf_component_register(SRCS "esp_lcd_st7121.c"
INCLUDE_DIRS "include"
REQUIRES "esp_lcd")
REQUIRES "esp_lcd" "esp_driver_gpio")

include(package_manager)
cu_pkg_define_version(${CMAKE_CURRENT_LIST_DIR})
# NOTE: this component deliberately does NOT call cu_pkg_define_version().
# That helper reads the version out of idf_component.yml and injects
# -D<NAME>_VER_{MAJOR,MINOR,PATCH} as target compile options, but
# include/esp_lcd_st7121.h already defines ESP_LCD_ST7121_VER_* itself, and this
# directory has no idf_component.yml, so the injected macros expanded to empty
# and GCC 15 rejected the redefinition under -Werror. The header is the single
# source of truth for the version here.
5 changes: 4 additions & 1 deletion platforms/tab5/components/esp_video/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ set(srcs "src/esp_video_buffer.c"
set(include_dirs "include")
set(priv_include_dirs "private_include")
set(priv_requires "vfs")
set(requires "esp_driver_cam" "esp_driver_isp" "esp_cam_sensor" "esp_h264" "esp_driver_jpeg")
# IDF 6 hollowed out the legacy `driver` component: it no longer re-exports the
# esp_driver_* / esp_hal_* headers, so `#include "driver/gpio.h"` in
# src/esp_video_init.c needs esp_driver_gpio named explicitly.
set(requires "esp_driver_cam" "esp_driver_isp" "esp_driver_gpio" "esp_cam_sensor" "esp_h264" "esp_driver_jpeg")

if(CONFIG_ESP_VIDEO_ENABLE_MIPI_CSI_VIDEO_DEVICE)
list(APPEND srcs "src/device/esp_video_csi_device.c")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ static esp_err_t csi_get_input_frame_type(uint32_t sensor_fmt, cam_ctlr_color_t
*csi_in_bpp = 12;
break;
case ESP_CAM_SENSOR_PIXFORMAT_YUV422:
*csi_color = CAM_CTLR_COLOR_YUV422;
// IDF 6 split CAM_CTLR_COLOR_YUV422 into one variant per packing
// order. YUYV is the layout CSI-2 uses for 8-bit YUV422 by default.
*csi_color = CAM_CTLR_COLOR_YUV422_YUYV;
*csi_in_bpp = 16;
break;
default:
Expand Down Expand Up @@ -116,7 +118,7 @@ static esp_err_t csi_get_output_frame_type_from_v4l2(uint32_t output_fmt, cam_ct
*out_bpp = 12;
break;
case V4L2_PIX_FMT_YUV422P:
*csi_color = CAM_CTLR_COLOR_YUV422;
*csi_color = CAM_CTLR_COLOR_YUV422_YUYV;
*out_bpp = 16;
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ static esp_err_t dvp_get_input_frame_type(esp_cam_sensor_output_format_t sensor_
*bpp = 16;
break;
case ESP_CAM_SENSOR_PIXFORMAT_YUV422:
*in_color = CAM_CTLR_COLOR_YUV422;
// IDF 6 split CAM_CTLR_COLOR_YUV422 by packing order; YUYV matches
// the CSI-2 8-bit YUV422 layout.
*in_color = CAM_CTLR_COLOR_YUV422_YUYV;
*v4l2_format = V4L2_PIX_FMT_YUV422P;
*bpp = 16;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,13 @@ static esp_err_t isp_get_output_frame_type(cam_ctlr_color_t ctlr_color, isp_colo
case CAM_CTLR_COLOR_YUV420:
*isp_color = ISP_COLOR_YUV420;
break;
case CAM_CTLR_COLOR_YUV422:
case CAM_CTLR_COLOR_YUV422_YVYU:
case CAM_CTLR_COLOR_YUV422_YUYV:
case CAM_CTLR_COLOR_YUV422_UYVY:
case CAM_CTLR_COLOR_YUV422_VYUY:
// IDF 6 replaced the single CAM_CTLR_COLOR_YUV422 with one enum per
// packing order, while the ISP side kept a single ISP_COLOR_YUV422
// (which means UYVY). Map every input variant onto it.
*isp_color = ISP_COLOR_YUV422;
break;
default:
Expand Down
6 changes: 5 additions & 1 deletion platforms/tab5/components/imlib/include/font.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
typedef struct {
int w;
int h;
uint8_t *data;
// The glyph bitmaps are const tables (font_ascii_8x16 is const unsigned
// char, the embedded unicode_font16x16 blob is const uint8_t), so the
// pointer must be const too. Assigning a const array into a plain
// uint8_t * is -Wdiscarded-qualifiers, which IDF 6 turns into an error.
const uint8_t *data;
} glyph_t;

extern const unsigned char font_ascii_8x16[];
Expand Down
4 changes: 3 additions & 1 deletion platforms/tab5/components/imlib/src/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,9 @@ void imlib_draw_ellipse(image_t *img, int cx, int cy, int rx, int ry, int rotati
typedef struct {
uint16_t w;
uint16_t h;
uint8_t *data;
// See font.h: the built-in glyph tables are const, and draw.c only reads
// from this pointer.
const uint8_t *data;
} font_t;

font_t gfont;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ const char key_value_map[81] = {
' ', // TAB
' ', // NONE
' ', // NONE
'4', '¥', '/', 'g', 'o', 'w',
// Was the full-width yen sign, whose UTF-8 bytes formed a multi-character
// constant (GCC 15 rejects that under -Werror). '$' matches the same slot
// in key_value_map_str below.
'4', '$', '/', 'g', 'o', 'w',
' ', // KANA
' ', // STOP
'<', // <-
Expand Down
38 changes: 22 additions & 16 deletions platforms/tab5/components/m5stack_tab5/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@

idf_component_register(
SRCS "m5stack_tab5.c" "esp_lcd_st7123.c"
INCLUDE_DIRS "include"
INCLUDE_DIRS "include/bsp"
PRIV_INCLUDE_DIRS "priv_include"
REQUIRES
driver
esp_lcd
esp_codec_dev
esp_lvgl_port
esp_lcd_ili9881c
esp_lcd_touch_st7123
esp_lcd_st7121
PRIV_REQUIRES usb spiffs fatfs
)

# IDF >= 6.0 no longer exposes esp_driver_* publicly through the legacy `driver`
# component, so each driver used by this BSP must be listed explicitly.
idf_component_register(
SRCS "m5stack_tab5.c" "esp_lcd_st7123.c"
INCLUDE_DIRS "include"
INCLUDE_DIRS "include/bsp"
PRIV_INCLUDE_DIRS "priv_include"
REQUIRES
esp_driver_gpio
esp_driver_i2c
esp_driver_i2s
esp_driver_ledc
esp_driver_sdmmc
esp_lcd
esp_codec_dev
esp_lvgl_port
esp_lcd_ili9881c
esp_lcd_touch_st7123
esp_lcd_st7121
PRIV_REQUIRES usb spiffs fatfs
)
5 changes: 4 additions & 1 deletion platforms/tab5/components/m5stack_tab5/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
dependencies:
espressif/esp_lcd_st7703: ^1.0.1
# esp_lcd_st7703 was inherited from the ESP32-P4-Function-EV-Board template
# this BSP was forked from. Tab5 panels are ILI9881C / ST7123 / ST7121 only,
# nothing here references ST7703, and its driver still uses the
# esp_lcd_panel_dev_config_t.color_space alias that IDF 6 removed.
espressif/esp_lcd_touch_st7123: ^1.0.0
espressif/esp_codec_dev: ^1.3.0
# lvgl/lvgl: ^8.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ esp_err_t bsp_spiffs_unmount(void);
* - ESP_ERR_NO_MEM If not enough memory or too many VFSes already registered
* - Others Fail
*/
esp_err_t bsp_sdcard_init(char *mount_point, size_t max_files);
esp_err_t bsp_sdcard_init(const char *mount_point, size_t max_files);

/**
* @brief Deinit SD card
Expand All @@ -276,7 +276,7 @@ esp_err_t bsp_sdcard_init(char *mount_point, size_t max_files);
* - ESP_OK: Success
* - Others: Fail
*/
esp_err_t bsp_sdcard_deinit(char *mount_point);
esp_err_t bsp_sdcard_deinit(const char *mount_point);

/**************************************************************************************************
*
Expand Down
40 changes: 28 additions & 12 deletions platforms/tab5/components/m5stack_tab5/m5stack_tab5.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ void bsp_reset_tp()

static sdmmc_card_t* card;

esp_err_t bsp_sdcard_init(char* mount_point, size_t max_files)
esp_err_t bsp_sdcard_init(const char* mount_point, size_t max_files)
{
esp_err_t ret_val = ESP_OK;

Expand Down Expand Up @@ -650,7 +650,7 @@ esp_err_t bsp_sdcard_init(char* mount_point, size_t max_files)
return ret_val;
}

esp_err_t bsp_sdcard_deinit(char* mount_point)
esp_err_t bsp_sdcard_deinit(const char* mount_point)
{
if (mount_point == NULL) {
return ESP_ERR_INVALID_STATE;
Expand Down Expand Up @@ -881,7 +881,9 @@ esp_codec_dev_handle_t bsp_audio_codec_microphone_init(void)
es7210_codec_cfg_t es7210_cfg = {
.ctrl_if = i2c_ctrl_if, // Codec Control interface
};
es7210_cfg.mic_selected = ES7120_SEL_MIC1 | ES7120_SEL_MIC2 | ES7120_SEL_MIC3 | ES7120_SEL_MIC4;
// esp_codec_dev 1.3.x spelled these ES7120_SEL_MIC*; the typo was fixed to
// ES7210_SEL_MIC* and the old names are gone from 1.4 onward.
es7210_cfg.mic_selected = ES7210_SEL_MIC1 | ES7210_SEL_MIC2 | ES7210_SEL_MIC3 | ES7210_SEL_MIC4;
const audio_codec_if_t* es7210_dev = es7210_codec_new(&es7210_cfg);
BSP_NULL_CHECK(es7210_dev, NULL);

Expand Down Expand Up @@ -1223,7 +1225,13 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t* config, bsp_l
.virtual_channel = 0,
.dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT,
.dpi_clock_freq_mhz = 60, // 720*1280 RGB24 60Hz RGB24 // 80,
.pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565,
// IDF 6 removed esp_lcd_dpi_panel_config_t.pixel_format; the pixel format
// is now a FourCC lcd_color_format_t. in_color_format describes what the
// frame buffer holds and out_color_format what the panel accepts. The
// driver defaults out to in, so naming both RGB565 keeps the previous
// behaviour explicit.
.in_color_format = LCD_COLOR_FMT_RGB565,
.out_color_format = LCD_COLOR_FMT_RGB565,
.num_fbs = 1,
.video_timing =
{
Expand All @@ -1236,7 +1244,8 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t* config, bsp_l
.vsync_pulse_width = 4,
.vsync_front_porch = 20,
},
.flags.use_dma2d = true,
// .flags.use_dma2d was removed in IDF 6; DMA2D is now opt-in per panel
// via esp_lcd_dpi_panel_enable_dma2d() right after panel creation.
};

ili9881c_vendor_config_t vendor_config = {
Expand All @@ -1262,6 +1271,9 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t* config, bsp_l
ESP_ERROR_CHECK(esp_lcd_panel_init(disp_panel));
// ESP_ERROR_CHECK(esp_lcd_panel_mirror(disp_panel, false, true));
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(disp_panel, true));
// Equivalent of the old `.flags.use_dma2d = true`: registers the built-in
// DMA2D draw-bitmap hook so the CPU is not asked to copy pixels itself.
ESP_ERROR_CHECK(esp_lcd_dpi_panel_enable_dma2d(disp_panel));

/* Return all handles */
ret_handles->io = io;
Expand Down Expand Up @@ -1404,7 +1416,10 @@ esp_err_t bsp_display_new_with_handles_to_st7123(const bsp_display_config_t* con
.virtual_channel = 0,
.dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT,
.dpi_clock_freq_mhz = 70, // DPI clock frequency
.pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565,
// IDF 6 removed esp_lcd_dpi_panel_config_t.pixel_format; see the
// ili9881c path above for the in/out color format rationale.
.in_color_format = LCD_COLOR_FMT_RGB565,
.out_color_format = LCD_COLOR_FMT_RGB565,
.num_fbs = 1,
.video_timing =
{
Expand All @@ -1417,10 +1432,8 @@ esp_err_t bsp_display_new_with_handles_to_st7123(const bsp_display_config_t* con
.vsync_back_porch = is_st7121 ? 24 : 8,
.vsync_front_porch = is_st7121 ? 200 : 220,
},
.flags =
{
.use_dma2d = true,
},
// .flags.use_dma2d was removed in IDF 6; DMA2D is enabled per panel
// right after creation, below.
};

st7123_vendor_config_t vendor_config = {
Expand Down Expand Up @@ -1455,6 +1468,8 @@ esp_err_t bsp_display_new_with_handles_to_st7123(const bsp_display_config_t* con
ESP_GOTO_ON_ERROR(esp_lcd_panel_reset(disp_panel), err, TAG, "LCD panel reset failed");
ESP_GOTO_ON_ERROR(esp_lcd_panel_init(disp_panel), err, TAG, "LCD panel init failed");
ESP_GOTO_ON_ERROR(esp_lcd_panel_disp_on_off(disp_panel, true), err, TAG, "LCD panel display on failed");
// Equivalent of the old `.flags.use_dma2d = true`.
ESP_GOTO_ON_ERROR(esp_lcd_dpi_panel_enable_dma2d(disp_panel), err, TAG, "LCD panel DMA2D enable failed");

/* Return all handles */
ret_handles->io = io;
Expand Down Expand Up @@ -1651,8 +1666,9 @@ static lv_indev_t* bsp_display_indev_init_to_st7123(lv_display_t* disp)
};
tp_io_config.scl_speed_hz = CONFIG_BSP_I2C_CLK_SPEED_HZ;

ret = esp_lcd_new_panel_io_i2c_v2(bsp_i2c_get_handle(), &tp_io_config, &tp_io_handle);
// ret = esp_lcd_new_panel_io_i2c(bsp_i2c_get_handle(), &tp_io_config, &tp_io_handle);
// IDF 6 folded the v1/v2 split into a single esp_lcd_new_panel_io_i2c()
// that always takes an i2c_master_bus_handle_t.
ret = esp_lcd_new_panel_io_i2c(bsp_i2c_get_handle(), &tp_io_config, &tp_io_handle);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to create ST7123 touch I2C IO: %s", esp_err_to_name(ret));
return NULL;
Expand Down
4 changes: 4 additions & 0 deletions platforms/tab5/components/power_monitor_ina226/src/ina226.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ bool INA226::begin(i2c_master_bus_handle_t bus_handle, uint8_t address)
.dev_addr_length = I2C_ADDR_BIT_LEN_7,
.device_address = address,
.scl_speed_hz = 400000,
// IDF 6 added scl_wait_us and flags to this struct; 0 keeps the driver
// default timeout and leaves ACK checking enabled.
.scl_wait_us = 0,
.flags = {},
};
ESP_ERROR_CHECK(i2c_master_bus_add_device(bus_handle, &dev_cfg, &i2c_dev_handle_ina226));

Expand Down
Loading
Loading