refactor: added defaults for serial & telnet

This commit is contained in:
Yurii
2024-10-24 04:00:06 +03:00
parent 3fb5eb32c3
commit 6c4f8a78a0
4 changed files with 24 additions and 12 deletions

View File

@@ -27,13 +27,13 @@ struct Settings {
uint8_t logLevel = DEFAULT_LOG_LEVEL;
struct {
bool enable = USE_SERIAL;
unsigned int baudrate = 115200;
bool enable = DEFAULT_SERIAL_ENABLE;
unsigned int baudrate = DEFAULT_SERIAL_BAUD;
} serial;
struct {
bool enable = USE_TELNET;
unsigned short port = 23;
bool enable = DEFAULT_TELNET_ENABLE;
unsigned short port = DEFAULT_TELNET_PORT;
} telnet;
UnitSystem unitSystem = UnitSystem::METRIC;

View File

@@ -30,12 +30,20 @@
#define BUILD_ENV "undefined"
#endif
#ifndef USE_SERIAL
#define USE_SERIAL true
#ifndef DEFAULT_SERIAL_ENABLE
#define DEFAULT_SERIAL_ENABLE true
#endif
#ifndef USE_TELNET
#define USE_TELNET true
#ifndef DEFAULT_SERIAL_BAUD
#define DEFAULT_SERIAL_BAUD 115200
#endif
#ifndef DEFAULT_TELNET_ENABLE
#define DEFAULT_TELNET_ENABLE true
#endif
#ifndef DEFAULT_TELNET_PORT
#define DEFAULT_TELNET_PORT 23
#endif
#ifndef USE_BLE