58 lines
1.9 KiB
C
Raw Normal View History

/**
* @file debugger.h
*
* @brief Header file for debugging functions and status in the ChainLube application.
*
* This file declares functions and status definitions for debugging purposes in the ChainLube project.
* It includes functions to print system information, WiFi information, format EEPROM data,
* handle debug messages, and manage the status of different debug ports.
*
* @author Marcel Peterkau
* @date 09.01.2024
*/
2023-02-23 23:14:58 +01:00
#ifndef _DEBUGGER_H_
#define _DEBUGGER_H_
#include <Arduino.h>
#include "webui.h"
2023-03-14 23:30:26 +01:00
const char PROGMEM helpCmd[] = "sysinfo - System Info\n"
"netinfo - WiFi Info\n"
"formatPDS - Format Persistence EEPROM Data\n"
"formatCFG - Format Configuration EEPROM Data\n"
"checkEE - Check EEPROM with checksum\n"
"dumpEE1k - dump the first 1kb of EEPROM to Serial\n"
"dumpEE - dump the whole EPPROM to Serial\n"
"resetPageEE - Reset the PersistenceData Page\n"
"dumpCFG - print Config struct\n"
"dumpPDS - print PersistanceStruct\n"
"saveEE - save EE-Data\n"
"showdtc - Show all DTCs\n"
"dumpGlobals - print globals\n";
2023-02-24 00:52:51 +01:00
typedef enum DebugStatus_e
{
disabled,
enabled
} DebugStatus_t;
typedef enum DebugPorts_e
{
2023-02-24 00:05:51 +01:00
dbg_Serial,
dbg_Webui,
dbg_cntElements
2023-02-24 00:52:51 +01:00
} DebugPorts_t;
2023-02-24 00:05:51 +01:00
const char sDebugPorts[dbg_cntElements][7] = {
"Serial",
2023-02-24 00:52:51 +01:00
"WebUI"};
2023-02-24 00:05:51 +01:00
extern DebugStatus_t DebuggerStatus[dbg_cntElements];
2023-02-23 23:14:58 +01:00
void initDebugger();
2023-02-24 00:05:51 +01:00
void pushCANDebug(uint32_t id, uint8_t dlc, uint8_t *data);
2023-02-23 23:14:58 +01:00
void Debug_pushMessage(const char *format, ...);
2023-02-24 00:05:51 +01:00
void SetDebugportStatus(DebugPorts_t port, DebugStatus_t status);
2023-03-14 23:30:26 +01:00
void Debug_Process();
2023-02-23 23:14:58 +01:00
#endif