EX-Display
EX-Display
Loading...
Searching...
No Matches
/home/runner/work/EX-Display/EX-Display/Defines.h
Go to the documentation of this file.
1/*
2 * © 2024 Peter Cole
3 *
4 * This is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * It is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this code. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef DEFINES_H
19#define DEFINES_H
20
21// Give log defines their values before user config
22#include "Logger.h"
23#define LOG_NONE LOG_NONE
24#define LOG_ERROR LOG_ERROR
25#define LOG_WARN LOG_WARN
26#define LOG_INFO LOG_INFO
27#define LOG_DEBUG LOG_DEBUG
28
29#ifndef PIO_UNIT_TESTING // Don't warn or use user config when testing
30// Incude user's myConfig.h if it exists.
31#if __has_include("myConfig.h")
32#include "myConfig.h"
33#else
34#warning myConfig.h not found, using defaults
35#endif // myConfig
36
37// Default settings for streams
38#ifndef CONSOLE_STREAM
39#define CONSOLE_STREAM Serial
40#endif // CONSOLE_STREAM
41#ifndef COMMANDSTATION_STREAM
42#if defined(ARDUINO_ARCH_ESP32)
43#define COMMANDSTATION_STREAM Serial2
44#else
45#define COMMANDSTATION_STREAM Serial
46#endif // PLATFORM TYPE
47#endif // COMMANDSTATION_STREAM
48#endif // PIO_UNIT_TESTING
49
50// Default log level WARN unless overridden
51#ifndef LOG_LEVEL
52#define LOG_LEVEL LOG_WARN
53#endif // LOG_LEVEL
54
55// Default to showing the EX-Display version for 2 seconds unless overridden
56#ifndef STARTUP_INFO_DELAY
57#define STARTUP_INFO_DELAY 3000
58#endif // STARTUP_INFO_DELAY
59
60#endif // DEFINES_H