ESP8266 RTOS 3.2 GPIO example

hongwazi
Posts: 1
Joined: Wed Jul 03, 2019 10:27 pm

ESP8266 RTOS 3.2 GPIO example

Postby hongwazi » Wed Jul 03, 2019 10:32 pm

ESP8266_RTOS_SDK-3.2/examples/peripherals/gpio
保持代码不变:编译,程序可以运行
修改代码:
以前:
#define GPIO_OUTPUT_IO_0 15
#define GPIO_OUTPUT_IO_1 16
#define GPIO_OUTPUT_PIN_SEL ((1ULL<<GPIO_OUTPUT_IO_0) | (GPIO_OUTPUT_IO_1 ))
修改后:
#define GPIO_OUTPUT_IO_0 10
#define GPIO_OUTPUT_PIN_SEL ((1ULL<<GPIO_OUTPUT_IO_0))

最后会卡死在: gpio_config(&io_conf);
其内部其实卡死在:
WRITE_PERI_REG(GPIO_PIN_REG(io_num), pin_reg.val);

为什么呢?

Her Mary
Posts: 394
Joined: Mon Oct 27, 2014 11:09 am

Re: ESP8266 RTOS 3.2 GPIO example

Postby Her Mary » Fri Jul 05, 2019 5:25 pm

GPIO10 应该是被 flash 占用了,不能作为 GPIO 用吧

Who is online

Users browsing this forum: Bing [Bot] and 6 guests