xiaozhi-esp32 icon indicating copy to clipboard operation
xiaozhi-esp32 copied to clipboard

将Button组件从V3.3.1升级到V4.1.2

Open SuhaylZhao opened this issue 8 months ago • 4 comments

Is your feature request related to a problem?

大佬们好, 小智项目目前使用的Button组件版本是V3.3.1 espressif/button: "^3.3.1" , 该版本GPIO Button没啥问题,ADC Button有较大缺陷,默认使用 ADC_UNIT_1 ,无法使用ADC_UNIT_2,即使在代码中改了也没用。在最新的版本 V4.1.2 中,允许用户选择使用ADC1或者ADC2,适用性更强。

Describe the solution you'd like.

将Button组件由V3.3.1升级到V4.1.2, 不过这两个版本API变化较大,需要修改小智项目中的封装好的Button类, 不过似乎还影响到了 espressif__esp_lvgl_port组件 ,不知道大佬是否有升级该组件的计划,期待大佬更新

Describe alternatives you've considered.

No response

Additional context.

No response

SuhaylZhao avatar Apr 10 '25 01:04 SuhaylZhao

不过似乎还影响到了 espressif__esp_lvgl_port组件

esp_lvgl_port 2.5.0 以上版本已适配 button v4,详见 esp_lvgl_port CHANGELOG

laride avatar Apr 10 '25 03:04 laride

@laride 确实,这样只需要改动项目中的Button就可以了,我先试试

SuhaylZhao avatar Apr 10 '25 03:04 SuhaylZhao

可以,麻烦测试成功了提个PR

78 avatar Apr 10 '25 08:04 78

@78 先膜拜一下大佬

已经提了,https://github.com/78/xiaozhi-esp32/pull/470

测试没有问题,用了一个粗暴的方式,用户代码现在是兼容V3.x和V4.x Button组件的。

SuhaylZhao avatar Apr 10 '25 08:04 SuhaylZhao