Files
espurna/code/espurna/debug.h
Max Prokhorov edb23dbfc4 Convert .ino -> .cpp (#2228)
- general conversion from .ino modules into a separate .cpp files
- clean-up internal headers, place libraries into .h. guard .cpp with _SUPPORT flags 
- fix some instances of shared variables instead of public methods
- tweak build system to still build a single source file via os environment variable ESPURNA_BUILD_SINGLE_SOURCE
2020-04-30 13:55:07 +03:00

48 lines
753 B
C++

/*
DEBUG MODULE
*/
#pragma once
#include "espurna.h"
#if DEBUG_WEB_SUPPORT
#include <ArduinoJson.h>
#endif
extern "C" {
void custom_crash_callback(struct rst_info*, uint32_t, uint32_t);
}
class PrintRaw;
class PrintHex;
enum class DebugLogMode : int {
Disabled = 0,
Enabled = 1,
SkipBoot = 2
};
bool debugLogBuffer();
void debugWebSetup();
void debugConfigure();
void debugConfigureBoot();
void debugSetup();
void debugSend(const char* format, ...);
void debugSend_P(PGM_P format, ...); // PGM_P is `const char*`
#if DEBUG_SUPPORT
#define DEBUG_MSG(...) debugSend(__VA_ARGS__)
#define DEBUG_MSG_P(...) debugSend_P(__VA_ARGS__)
#endif
#ifndef DEBUG_MSG
#define DEBUG_MSG(...)
#define DEBUG_MSG_P(...)
#endif