最近调试IDF中的pcnt,最开始使用的芯片是ESP32C3,编译时会报错
/home/ubuntu/.espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld: /home/ubuntu/project/esp32c3/v5.0/rotary_encoder/build/../main/rotary_encoder_example_main.c:83: undefined reference to `pcnt_unit_clear_count'
/home/ubuntu/.espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld: /home/ubuntu/project/esp32c3/v5.0/rotary_encoder/build/../main/rotary_encoder_example_main.c:85: undefined reference to `pcnt_unit_start'
/home/ubuntu/.espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld: /home/ubuntu/project/esp32c3/v5.0/rotary_encoder/build/../main/rotary_encoder_example_main.c:101: undefined reference to `pcnt_unit_get_count'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the
会报各种未定义的错误,实际上是有的,在driver/pulse_cnt.h下面有声明,无意间把target改成ESP32S3编译没问题
例外一个python脚本文件中有这么一段,猜测应该是支持的型号吧