Verified Commit ef03f13b authored by Rahix's avatar Rahix
Browse files

fix(hw-locks): Don't show warnings for 0 wait acquires


Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent dcb9c8f9
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment