wuxx / nanoESP32-S2

46 stars 9 forks source link

reference of led_strip_main and board_led_write_rgb #1

Open MehrdadUrban opened 2 years ago

MehrdadUrban commented 2 years ago

Hi I could not find the implementation detail of the following functions. Where can I find them?

extern void led_strip_main(void); extern void board_led_write_rgb(int r, int g, int b);

wuxx commented 2 years ago

hello, please check this file

./examples/common_components/led_strip/led_strip_rmt_ws2812.c

daimawujia commented 2 years ago

“./examples/common_components/led_strip/led_strip_rmt_ws2812.c”,这个文件应该从哪里寻找呢? "./examples/common_components/led_strip/led_strip_rmt_ws2812.c", where should I look for this file? 同时我使用ESP-IDF编译时会提示缺少led_strip组件而无法继续编译,如图。 At the same time, when I compile using ESP-IDf, I will be prompted that the “led_strip“ component is missing and the compilation cannot continue. As shown in figure 编译

wuxx commented 2 years ago

此处的CMakelists.txt会包含这个组件,你的代码是tinyUSB吗,可以参考着在合适地方添加即可。 https://github.com/espressif/esp-idf/blob/079b5b1857242d6288478c62dc36a843718882e9/examples/get-started/blink/CMakeLists.txt#L5

daimawujia commented 2 years ago

代码是拉取的这个仓库,下载下来之后,直接使用之前已经安装配置好的ESP-IDF环境,不能编译所以就添加了tinyUSB进去。 现在该工程的CMakelists.txt文件添加了“led_strip”组件的路径之后可以进行编译了,但是还是编译不过,如图1,看起来是因为图2中添加的编译选项没有起作用,导致“CFG_TUSB_MCU”没有正确的定义而使用了默认的定义。请问这怎么解决呢,谢谢。 image image

wuxx commented 2 years ago

没有试过vscode编译,建议你可以先在命令行环境尝试编译,ESP32-S2 在tinyUSB下本身就已经有ws2812b的支持,命令行下编译是非常顺利的,参考修改配置就可以了。 https://github.com/hathach/tinyusb/tree/master/hw/bsp/esp32s2 https://github.com/hathach/tinyusb/blob/55a5fd59d7263289f5c26d52ab206ed571cc1e0c/hw/bsp/esp32s2/boards/esp32s2.c#L125