Merge branch 'contrib/github_pr_18569_v5.4' into 'release/v5.4'

fix(i2c_master): yield from ISR when no matching device is found (GitHub PR) (v5.4)

See merge request espressif/esp-idf!48429
This commit is contained in:
morris
2026-05-28 11:18:21 +08:00
+5 -1
View File
@@ -767,7 +767,10 @@ static void IRAM_ATTR i2c_master_isr_handler_default(void *arg)
}
xSemaphoreGiveFromISR(i2c_master->bus_lock_mux, &HPTaskAwoken);
if (i2c_dev == NULL) {
return;
// HPTaskAwoken may have been set by xQueueSendFromISR / xSemaphoreTakeFromISR /
// xSemaphoreGiveFromISR above; fall through to the yield check at the end of
// the ISR rather than returning directly.
goto out;
}
i2c_master_event_data_t evt = {
.event = i2c_master->event,
@@ -805,6 +808,7 @@ static void IRAM_ATTR i2c_master_isr_handler_default(void *arg)
xSemaphoreGiveFromISR(i2c_master->cmd_semphr, &HPTaskAwoken);
}
out:
if (HPTaskAwoken == pdTRUE) {
portYIELD_FROM_ISR();
}