JXCT Soil Sensor 7-in-1
v3.4.9 (June 2025)
Professional IoT soil monitoring system with ESP32, Modbus RTU, MQTT, and advanced compensation algorithms
Загрузка...
Поиск...
Не найдено
debug.h
См. документацию.
1
#ifndef DEBUG_H
2
#define DEBUG_H
3
4
#include <Arduino.h>
5
6
// Условная компиляция отладки
7
// В релизной сборке весь отладочный код будет исключен из прошивки
8
#ifdef DEBUG_MODE
9
#define DEBUG_PRINT(x) Serial.print(x)
10
#define DEBUG_PRINTLN(x) Serial.println(x)
11
#define DEBUG_PRINTF(fmt, ...) Serial.printf(fmt, ##__VA_ARGS__)
12
#define DEBUG_PRINT_VAR(name, value) Serial.printf("[DEBUG] %s = %s\n", name, String(value).c_str())
13
#define DEBUG_PRINT_INT(name, value) Serial.printf("[DEBUG] %s = %d\n", name, value)
14
#define DEBUG_PRINT_FLOAT(name, value) Serial.printf("[DEBUG] %s = %.2f\n", name, value)
15
#else
16
// В релизной сборке эти макросы превращаются в пустые операции
17
#define DEBUG_PRINT(x)
18
#define DEBUG_PRINTLN(x)
19
#define DEBUG_PRINTF(fmt, ...)
20
#define DEBUG_PRINT_VAR(name, value)
21
#define DEBUG_PRINT_INT(name, value)
22
#define DEBUG_PRINT_FLOAT(name, value)
23
#endif
24
25
// Критические ошибки всегда выводятся (для отладки в продакшне)
26
#define ERROR_PRINT(x) Serial.print(x)
27
#define ERROR_PRINTLN(x) Serial.println(x)
28
#define ERROR_PRINTF(fmt, ...) Serial.printf(fmt, ##__VA_ARGS__)
29
30
// Информационные сообщения (можно отключить в критических случаях)
31
#ifdef INFO_MODE
32
#define INFO_PRINT(x) Serial.print(x)
33
#define INFO_PRINTLN(x) Serial.println(x)
34
#define INFO_PRINTF(fmt, ...) Serial.printf(fmt, ##__VA_ARGS__)
35
#else
36
#define INFO_PRINT(x)
37
#define INFO_PRINTLN(x)
38
#define INFO_PRINTF(fmt, ...)
39
#endif
40
41
#endif
// DEBUG_H
include
debug.h
Документация по JXCT Soil Sensor 7-in-1. Последние изменения: Ср 25 Июн 2025 01:11:47. Создано системой
1.13.2