Move all firmware files to subdirectory

This commit is contained in:
2023-05-21 15:06:44 +01:00
parent 3d8ec33cd3
commit 8c957d043a
46 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
idf_component_register(
SRCS "fatal.c"
INCLUDE_DIRS "."
REQUIRES log
)

View File

@@ -0,0 +1,16 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright (c) Camden Dixie O'Brien
*/
#include "fatal.h"
#include "esp_log.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) { }
}

View File

@@ -0,0 +1,21 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright (c) Camden Dixie O'Brien
*
* Fatal error module.
*
* This small module provides the FATAL() macro, intended to be used
* to signal a fatal error. This prompts a system restart.
*/
#ifndef FATAL_H
#define FATAL_H
/**
* Signals a fatal error.
*/
#define FATAL() _fatal(__func__, __FILE__, __LINE__)
void _fatal(const char *func, const char *file, unsigned line);
#endif