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 tags found
No related merge requests found
...@@ -64,8 +64,7 @@ int main(void) ...@@ -64,8 +64,7 @@ int main(void)
NULL, NULL,
tskIDLE_PRIORITY + 3, tskIDLE_PRIORITY + 3,
NULL) != pdPASS) { NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "Serial"); panic("Failed to create %s task!", "Serial");
abort();
} }
/* PMIC */ /* PMIC */
...@@ -76,8 +75,7 @@ int main(void) ...@@ -76,8 +75,7 @@ int main(void)
NULL, NULL,
tskIDLE_PRIORITY + 4, tskIDLE_PRIORITY + 4,
NULL) != pdPASS) { NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "PMIC"); panic("Failed to create %s task!", "PMIC");
abort();
} }
/* BHI160 */ /* BHI160 */
...@@ -88,8 +86,7 @@ int main(void) ...@@ -88,8 +86,7 @@ int main(void)
NULL, NULL,
tskIDLE_PRIORITY + 1, tskIDLE_PRIORITY + 1,
NULL) != pdPASS) { NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "BHI160"); panic("Failed to create %s task!", "BHI160");
abort();
} }
/* MAX30001 */ /* MAX30001 */
...@@ -100,8 +97,7 @@ int main(void) ...@@ -100,8 +97,7 @@ int main(void)
NULL, NULL,
tskIDLE_PRIORITY + 1, tskIDLE_PRIORITY + 1,
NULL) != pdPASS) { NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "MAX30001"); panic("Failed to create %s task!", "MAX30001");
abort();
} }
/* API */ /* API */
if (xTaskCreate( if (xTaskCreate(
...@@ -111,12 +107,7 @@ int main(void) ...@@ -111,12 +107,7 @@ int main(void)
NULL, NULL,
tskIDLE_PRIORITY + 2, tskIDLE_PRIORITY + 2,
&dispatcher_task_id) != pdPASS) { &dispatcher_task_id) != pdPASS) {
LOG_CRIT( panic("Failed to create %s task!", "API Dispatcher");
"startup",
"Failed to create %s task!",
"API Dispatcher"
);
abort();
} }
/* BLE */ /* BLE */
...@@ -128,8 +119,7 @@ int main(void) ...@@ -128,8 +119,7 @@ int main(void)
NULL, NULL,
tskIDLE_PRIORITY + 3, tskIDLE_PRIORITY + 3,
NULL) != pdPASS) { NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "BLE"); panic("Failed to create %s task!", "BLE");
abort();
} }
} }
...@@ -141,8 +131,7 @@ int main(void) ...@@ -141,8 +131,7 @@ int main(void)
NULL, NULL,
tskIDLE_PRIORITY + 1, tskIDLE_PRIORITY + 1,
NULL) != pdPASS) { NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "LED"); panic("Failed to create %s task!", "LED");
abort();
} }
/* Lifecycle */ /* Lifecycle */
...@@ -153,8 +142,7 @@ int main(void) ...@@ -153,8 +142,7 @@ int main(void)
NULL, NULL,
tskIDLE_PRIORITY + 3, tskIDLE_PRIORITY + 3,
NULL) != pdPASS) { NULL) != pdPASS) {
LOG_CRIT("startup", "Failed to create %s task!", "Lifecycle"); panic("Failed to create %s task!", "Lifecycle");
abort();
} }
/* /*
...@@ -165,6 +153,5 @@ int main(void) ...@@ -165,6 +153,5 @@ int main(void)
LOG_DEBUG("startup", "Starting FreeRTOS ..."); LOG_DEBUG("startup", "Starting FreeRTOS ...");
vTaskStartScheduler(); vTaskStartScheduler();
LOG_CRIT("startup", "FreeRTOS did not start due to unknown error!"); panic("FreeRTOS did not start due to unknown error!");
abort();
} }
...@@ -364,10 +364,7 @@ void vLifecycleTask(void *pvParameters) ...@@ -364,10 +364,7 @@ void vLifecycleTask(void *pvParameters)
core1_mutex = xSemaphoreCreateMutexStatic(&core1_mutex_data); core1_mutex = xSemaphoreCreateMutexStatic(&core1_mutex_data);
if (xSemaphoreTake(core1_mutex, 0) != pdTRUE) { if (xSemaphoreTake(core1_mutex, 0) != pdTRUE) {
LOG_CRIT( panic("lifecycle: Failed to acquire mutex after creation.");
"lifecycle", "Failed to acquire mutex after creation."
);
vTaskDelay(portMAX_DELAY);
} }
LOG_DEBUG("lifecycle", "Booting core 1 ..."); LOG_DEBUG("lifecycle", "Booting core 1 ...");
......
...@@ -117,5 +117,5 @@ void vApplicationGetTimerTaskMemory( ...@@ -117,5 +117,5 @@ void vApplicationGetTimerTaskMemory(
void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName) 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.
Please register or to comment