Compare commits
2 Commits
faf4cae642
...
44ff589cec
| Author | SHA1 | Date | |
|---|---|---|---|
| 44ff589cec | |||
| 1c1f155ce0 |
@@ -2,3 +2,4 @@
|
||||
#define WARN
|
||||
#define ERROR
|
||||
#define DEBUG
|
||||
#define DEEP_DEBUG
|
||||
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#define MOD "modules/lcd/lcd.h"
|
||||
#include "flags.h"
|
||||
#include "modules/logger/system_logger.h"
|
||||
#include <LiquidCrystal_I2C.h>
|
||||
@@ -25,14 +26,29 @@ lcd::lcd(system_logger *logger) {
|
||||
lcd::~lcd() {}
|
||||
|
||||
int lcd::init() {
|
||||
#ifdef DEEP_DEBUG
|
||||
if (_logger != nullptr) {
|
||||
_logger->debug(String(MOD) + ": LCD init Begin");
|
||||
}
|
||||
#endif
|
||||
_display->init();
|
||||
_display->backlight();
|
||||
_display->clear();
|
||||
_display->setCursor(0, 0);
|
||||
#ifdef DEEP_DEBUG
|
||||
if (_logger != nullptr) {
|
||||
_logger->debug(String(MOD) + ": LCD init End");
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int lcd::print_message(String message) {
|
||||
#ifdef DEEP_DEBUG
|
||||
if (_logger != nullptr) {
|
||||
_logger->debug(String(MOD) + ": LCD print_message Begin");
|
||||
}
|
||||
#endif
|
||||
_display->clear();
|
||||
_display->setCursor(0, 0);
|
||||
_display->print(message);
|
||||
@@ -41,5 +57,12 @@ int lcd::print_message(String message) {
|
||||
_logger->info(message);
|
||||
}
|
||||
#endif
|
||||
#ifdef DEEP_DEBUG
|
||||
if (_logger != nullptr) {
|
||||
_logger->debug(String(MOD) + ": LCD print_message End");
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#undef MOD
|
||||
@@ -25,6 +25,10 @@ public:
|
||||
#ifdef DEBUG
|
||||
int debug(String message);
|
||||
#endif
|
||||
|
||||
#ifdef DEEP_DEBUG
|
||||
int deep_debug(String message);
|
||||
#endif
|
||||
};
|
||||
|
||||
system_logger::system_logger(HardwareSerial *output)
|
||||
@@ -69,3 +73,9 @@ int system_logger::debug(String message) {
|
||||
return this->print_message(" [DEBUG] ", message);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEEP_DEBUG
|
||||
int system_logger::deep_debug(String message) {
|
||||
return this->print_message(" [DEEP_DEBUG] ", message);
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user