Skip to content

Commit 2d2d258

Browse files
committed
Switch to NEGEDGE interrupt
This should result in less interrupts. The original code I forked stated NEGEDGE was causing issues. It does not in my tests.
1 parent 4f020fc commit 2d2d258

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

esphome/components/MhiAcCtrl/MHI-AC-Ctrl-core.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,7 @@ InitError init(const Config& config) {
639639
io_conf.pin_bit_mask = (1ULL<<config.sclk_pin);
640640
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
641641
io_conf.pull_up_en = GPIO_PULLUP_ENABLE; // required to prevent abort() caused by floating pin when daughtboard not connected
642-
io_conf.intr_type = GPIO_INTR_LOW_LEVEL; // when this is set to NEGEDGE, DMA sometimes doesn't read the last 4 bytes
643-
// if not connected to AC (plugged in) when starting, it will crash - probably because it
644-
// immediately calls an interrupt
642+
io_conf.intr_type = GPIO_INTR_NEGEDGE;
645643
gpio_config(&io_conf);
646644

647645
gpio_install_isr_service(ESP_INTR_FLAG_DEFAULT);

0 commit comments

Comments
 (0)