Skip to content

Commit 7140894

Browse files
galjonsfigurmarcelstoer
authored andcommitted
Update hook after updating GPIO bits (#3091)
Fixes #3089
1 parent 7a77d76 commit 7140894

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/platform/platform.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ int platform_gpio_register_intr_hook(uint32_t bits, platform_hook_function hook)
307307
uint32_t old_bits = oh.entry[i].bits;
308308
*(volatile uint32_t *) &oh.entry[i].bits = bits;
309309
*(volatile uint32_t *) &oh.all_bits = (oh.all_bits & ~old_bits) | bits;
310+
ETS_GPIO_INTR_DISABLE();
311+
// This is a structure copy, so interrupts need to be disabled
312+
platform_gpio_hook = oh;
313+
ETS_GPIO_INTR_ENABLE();
310314
return 1;
311315
}
312316
}

0 commit comments

Comments
 (0)