Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interupts are not always cleared after soft reset (notably GPIO2) #524

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion platforms/esp8266/src/esp_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,12 @@ void (*mgos_nsleep100)(uint32_t n);
uint32_t mgos_bitbang_n100_cal;

enum mgos_init_result mgos_gpio_hal_init(void) {
for (int i = 0; i < 16; i++) {
// Interupts are not cleared after soft reset (notably GPIO2)
// Probably the GPIO2 is triggered because of the second UART - U1TXD,
// which is transmitting data during boot. Clear everything
for (int i = 0; i < GPIO_PIN_COUNT; i++) {
mgos_gpio_hal_disable_int(i);
mgos_gpio_hal_clear_int(i);
}
#ifdef RTOS_SDK
_xt_isr_attach(ETS_GPIO_INUM, (void *) esp8266_gpio_isr, NULL);
Expand Down