4#include <esp_debug_helpers.h>
6#include <freertos/FreeRTOS.h>
7#include <freertos/task.h>
10#ifndef ENABLE_CZECH_ERRORS
11#define ENABLE_CZECH_ERRORS false
14[[gnu::always_inline]]
inline void sanityCheck(
bool expression,
const char* tag,
const char* errorMessage,
unsigned stackTraceDepth = 10) {
16 ESP_LOGE(tag,
"%s", errorMessage);
17 esp_backtrace_print(stackTraceDepth);
19 vTaskDelay(100000 / portTICK_PERIOD_MS);
41[[gnu::always_inline]]
inline void sanityCheck(
bool expression,
const char* tag,
ErrorCodes errorCode,
unsigned stackTraceDepth = 10) {
45[[gnu::always_inline]]
inline void checkRange(
int value,
int min,
int max,
const char* tag,
unsigned stackTraceDepth = 10) {
static const std::string errors[]
Definition: Error.hpp:29
#define ENABLE_CZECH_ERRORS
Definition: Error.hpp:11
ErrorCodes
Definition: Error.hpp:23
@ VariableUnderflow
Definition: Error.hpp:26
@ VariableOverflow
Definition: Error.hpp:25
@ NoError
Definition: Error.hpp:24
void checkRange(int value, int min, int max, const char *tag, unsigned stackTraceDepth=10)
Definition: Error.hpp:45
static const std::string errorsCs[]
Definition: Error.hpp:35
void sanityCheck(bool expression, const char *tag, const char *errorMessage, unsigned stackTraceDepth=10)
Definition: Error.hpp:14