Create fatal component to handle fatal errors

This commit is contained in:
2023-05-14 21:13:35 +01:00
parent cc020d12bf
commit ae1d470b4b
5 changed files with 51 additions and 1 deletions

17
components/fatal/fatal.c Normal file
View File

@@ -0,0 +1,17 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright (c) Camden Dixie O'Brien
*/
#include "fatal.h"
#include "esp_log.h"
#include "esp_system.h"
#define TAG "Fatal"
void _fatal(const char *func, const char *file, unsigned line)
{
ESP_LOGE(TAG, "%s() @ %s:%u", func, file, line);
while (1) { }
}