diff --git a/epicardium/modules/hw-lock.c b/epicardium/modules/hw-lock.c index cc9986ec96285c7f2f42e6b06a51364d656f2b0e..ce88d921748302edd849eea0b923e6c61eab8dec 100644 --- a/epicardium/modules/hw-lock.c +++ b/epicardium/modules/hw-lock.c @@ -28,9 +28,14 @@ int hwlock_acquire(enum hwlock_periph p, TickType_t wait) TaskHandle_t task = xTaskGetCurrentTaskHandle(); if (xSemaphoreTake(hwlock_mutex[p], wait) != pdTRUE) { + /* Don't print warnings for 0 wait acquires */ + if (wait == 0) { + return -EBUSY; + } + LOG_WARN( "hwlock", - "Lock %u is busy, held by: %s, attempt to accquire by: %s", + "Lock %u is busy! Held by \"%s\" and attempted to accquire by \"%s\"", p, pcTaskGetName(hwlock_tasks[p]), pcTaskGetName(task)