Skip to content
Snippets Groups Projects
Verified Commit 0e5c6243 authored by rahix's avatar rahix
Browse files

chore(epicardium): Use panic() for all critical errors


Unify unrecoverable errors to use panic() in all cases.  This will allow
further changes to panic() to work for all critical errors.

Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 070867f8
No related branches found
No related tags found
1 merge request!326Add a panic() function
Pipeline #4112 passed
......@@ -64,8 +64,7 @@ int main(void)
NULL,
tskIDLE_PRIORITY + 3,
NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "Serial");
abort();
panic("Failed to create %s task!", "Serial");
}
/* PMIC */
......@@ -76,8 +75,7 @@ int main(void)
NULL,
tskIDLE_PRIORITY + 4,
NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "PMIC");
abort();
panic("Failed to create %s task!", "PMIC");
}
/* BHI160 */
......@@ -88,8 +86,7 @@ int main(void)
NULL,
tskIDLE_PRIORITY + 1,
NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "BHI160");
abort();
panic("Failed to create %s task!", "BHI160");
}
/* MAX30001 */
......@@ -100,8 +97,7 @@ int main(void)
NULL,
tskIDLE_PRIORITY + 1,
NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "MAX30001");
abort();
panic("Failed to create %s task!", "MAX30001");
}
/* API */
if (xTaskCreate(
......@@ -111,12 +107,7 @@ int main(void)
NULL,
tskIDLE_PRIORITY + 2,
&dispatcher_task_id) != pdPASS) {
LOG_CRIT(
"startup",
"Failed to create %s task!",
"API Dispatcher"
);
abort();
panic("Failed to create %s task!", "API Dispatcher");
}
/* BLE */
......@@ -128,8 +119,7 @@ int main(void)
NULL,
tskIDLE_PRIORITY + 3,
NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "BLE");
abort();
panic("Failed to create %s task!", "BLE");
}
}
......@@ -141,8 +131,7 @@ int main(void)
NULL,
tskIDLE_PRIORITY + 1,
NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "LED");
abort();
panic("Failed to create %s task!", "LED");
}
/* Lifecycle */
......@@ -153,8 +142,7 @@ int main(void)
NULL,
tskIDLE_PRIORITY + 3,
NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "Lifecycle");
abort();
panic("Failed to create %s task!", "Lifecycle");
}
/*
......@@ -165,6 +153,5 @@ int main(void)
LOG_DEBUG("startup", "Starting FreeRTOS ...");
vTaskStartScheduler();
LOG_CRIT("startup", "FreeRTOS did not start due to unknown error!");
abort();
panic("FreeRTOS did not start due to unknown error!");
}
......@@ -364,10 +364,7 @@ void vLifecycleTask(void *pvParameters)
core1_mutex = xSemaphoreCreateMutexStatic(&core1_mutex_data);
if (xSemaphoreTake(core1_mutex, 0) != pdTRUE) {
LOG_CRIT(
"lifecycle", "Failed to acquire mutex after creation."
);
vTaskDelay(portMAX_DELAY);
panic("lifecycle: Failed to acquire mutex after creation.");
}
LOG_DEBUG("lifecycle", "Booting core 1 ...");
......
......@@ -117,5 +117,5 @@ void vApplicationGetTimerTaskMemory(
void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName)
{
LOG_CRIT("rtos", "Task \"%s\" overflowed stack!", pcTaskName);
panic("Task \"%s\" overflowed stack!", pcTaskName);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment