Skip to content
Merged
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
16 changes: 6 additions & 10 deletions drivers/ipm/ipm_esp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,14 @@ static int esp32_ipm_send(const struct device *dev, int wait, uint32_t id,
while (!atomic_cas(&dev_data->control->lock,
ESP32_IPM_LOCK_FREE_VAL,
dev_data->this_core_id)) {
/* Do not wait for availability */
if (wait == 0) {
irq_unlock(key);

k_busy_wait(1);

if ((wait != -1) && (wait > 0)) {
/* lock could not be held this time, return */
wait--;
if (wait == 0) {
irq_unlock(key);

return -ETIMEDOUT;
}
return -EBUSY;
}

k_busy_wait(1);
}

/* Only the lower 16bits of id are used */
Expand Down