Skip to content
Snippets Groups Projects
Commit a5ac02a6 authored by swym's avatar swym
Browse files

hwlock: print task name instead of PC, print PC with LOG_DEBUG

parent 2216fe76
No related branches found
No related tags found
No related merge requests found
Pipeline #3297 passed
......@@ -25,18 +25,25 @@ int hwlock_acquire(enum hwlock_periph p, TickType_t wait)
if (p >= _HWLOCK_MAX) {
return -EINVAL;
}
TaskHandle_t task = xTaskGetCurrentTaskHandle();
if (xSemaphoreTake(hwlock_mutex[p], wait) != pdTRUE) {
LOG_WARN(
"hwlock",
"Lock %u is busy. [pc %p]",
"Lock %u is busy, held by: %s, attempt to accquire by: %s",
p,
pcTaskGetName(hwlock_tasks[p]),
pcTaskGetName(task)
);
LOG_DEBUG(
"hwlock",
"...attempted to lock from pc %p",
__builtin_return_address(0)
);
return -EBUSY;
}
hwlock_tasks[p] = xTaskGetCurrentTaskHandle();
hwlock_tasks[p] = task;
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment