esp32c3在别的.c文件用微妙函数ets_delay_us(20)函数报错?

fst202130609
Posts: 171
Joined: Thu Sep 23, 2021 10:03 am

esp32c3在别的.c文件用微妙函数ets_delay_us(20)函数报错?

Postby fst202130609 » Thu Nov 04, 2021 8:34 am

没添加文件是这个错../main/motor.c:41:21: error: implicit declaration of function 'ets_delay_us' [-Werror=implicit-function-declaration]
ets_delay_us(DELAY_us);
我添加头文件也报错,../main/motor.c:4:10: fatal error: rom/ets_sys.h: No such file or directory
#include "rom/ets_sys.h"

ESP_ICY
Posts: 404
Joined: Mon Aug 23, 2021 11:10 am

Re: esp32c3在别的.c文件用微妙函数ets_delay_us(20)函数报错?

Postby ESP_ICY » Tue Nov 09, 2021 7:48 am

别的.c文件是什么意思,你是新建了一个程序进行编译是吗

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: esp32c3在别的.c文件用微妙函数ets_delay_us(20)函数报错?

Postby ESP_morris » Fri Nov 12, 2021 5:46 am

#include "esp_rom_sys.h",然后使用esp_rom_delay_us应该可以解决你的问题

Who is online

Users browsing this forum: Baidu [Spider] and 65 guests