mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Switch to ArduinoLog library
This commit is contained in:
parent
25a6dfbbcc
commit
305ce43eb5
@ -31,7 +31,6 @@
|
||||
#include <FS.h> // Include the SPIFFS library
|
||||
#endif
|
||||
|
||||
//#include "hasp_log.h"
|
||||
#include "hasp_debug.h"
|
||||
#include "hasp_config.h"
|
||||
#include "hasp_dispatch.h"
|
||||
|
@ -8,7 +8,6 @@
|
||||
#endif
|
||||
|
||||
#include "hasp_config.h"
|
||||
//#include "hasp_log.h"
|
||||
#include "hasp_debug.h"
|
||||
#include "hasp_http.h"
|
||||
#include "hasp_wifi.h"
|
||||
|
@ -1,14 +1,12 @@
|
||||
#include <Ticker.h>
|
||||
#include "ArduinoLog.h"
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "lvgl.h"
|
||||
#include "lv_fs_if.h"
|
||||
|
||||
#include "TFT_eSPI.h"
|
||||
|
||||
#include "lv_zifont.h"
|
||||
|
||||
#include "hasp_log.h"
|
||||
#include "hasp_tft.h"
|
||||
#include "hasp_debug.h"
|
||||
#include "hasp_config.h"
|
||||
@ -16,7 +14,7 @@
|
||||
#include "hasp_gui.h"
|
||||
#include "hasp.h"
|
||||
|
||||
#if HASP_USE_PNGDECODE != 0
|
||||
#if HASP_USE_PNGDECODE
|
||||
#include "png_decoder.h"
|
||||
#endif
|
||||
|
||||
@ -95,7 +93,7 @@ void debugLvgl(lv_log_level_t level, const char * file, uint32_t line, const cha
|
||||
{
|
||||
char buffer[128];
|
||||
snprintf(buffer, sizeof(buffer), PSTR("LVGL: %s@%d->%s"), file, line, dsc);
|
||||
debugPrintln(buffer);
|
||||
Log.warning(buffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -147,7 +145,7 @@ void tft_espi_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * c
|
||||
case 2:
|
||||
// Send to remote client
|
||||
if(webClient->client().write(pixel, i) != i) {
|
||||
errorPrintln(F("GUI: %sPixelbuffer not completely sent"));
|
||||
Log.warning(F("GUI: Pixelbuffer not completely sent"));
|
||||
lv_disp_flush_ready(disp); /* tell lvgl that flushing is done */
|
||||
return;
|
||||
}
|
||||
@ -166,7 +164,7 @@ void tft_espi_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * c
|
||||
case 2:
|
||||
// Send to remote client
|
||||
if(webClient->client().write(pixel, i) != i) {
|
||||
errorPrintln(F("GUI: %sPixelbuffer not completely sent"));
|
||||
Log.warning(F("GUI: Pixelbuffer not completely sent"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -306,22 +304,15 @@ void guiSetup(JsonObject settings)
|
||||
lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize);
|
||||
#endif
|
||||
|
||||
char buffer[128];
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("LVGL: Version : %u.%u.%u %s"), LVGL_VERSION_MAJOR, LVGL_VERSION_MINOR,
|
||||
LVGL_VERSION_PATCH, F(LVGL_VERSION_INFO));
|
||||
debugPrintln(buffer);
|
||||
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("LVGL: Rotation : %d"), guiRotation);
|
||||
debugPrintln(buffer);
|
||||
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("LVGL: MEM size : %d"), LV_MEM_SIZE);
|
||||
debugPrintln(buffer);
|
||||
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("LVGL: VFB size : %d"), (size_t)sizeof(lv_color_t) * guiVDBsize);
|
||||
debugPrintln(buffer);
|
||||
// char buffer[128];
|
||||
Log.verbose(F("LVGL: Version : %u.%u.%u %s"), LVGL_VERSION_MAJOR, LVGL_VERSION_MINOR, LVGL_VERSION_PATCH,
|
||||
PSTR(LVGL_VERSION_INFO));
|
||||
Log.verbose(F("LVGL: Rotation : %d"), guiRotation);
|
||||
Log.verbose(F("LVGL: MEM size : %d"), LV_MEM_SIZE);
|
||||
Log.verbose(F("LVGL: VFB size : %d"), (size_t)sizeof(lv_color_t) * guiVDBsize);
|
||||
|
||||
#if LV_USE_LOG != 0
|
||||
debugPrintln(F("LVGL: NOT Registering lvgl logging handler"));
|
||||
Log.warning(F("LVGL: NOT Registering lvgl logging handler"));
|
||||
// lv_log_register_print_cb(debugLvgl); /* register print function for debugging */
|
||||
#endif
|
||||
|
||||
@ -401,8 +392,7 @@ void guiSetup(JsonObject settings)
|
||||
|
||||
/* Setup Backlight Control Pin */
|
||||
if(guiBacklightPin >= 0) {
|
||||
snprintf(buffer, sizeof(buffer), PSTR("LVGL: Backlight: Pin %i"), guiBacklightPin);
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("LVGL: Backlight: Pin %i"), guiBacklightPin);
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
// configure LED PWM functionalitites
|
||||
@ -485,9 +475,7 @@ bool guiGetConfig(const JsonObject & settings)
|
||||
array.add(calData[i]);
|
||||
}
|
||||
|
||||
serializeJson(settings, Serial);
|
||||
Serial.println();
|
||||
|
||||
configOutput(settings);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -506,7 +494,7 @@ bool guiSetConfig(const JsonObject & settings)
|
||||
|
||||
if(!settings[FPSTR(F_GUI_POINTER)].isNull()) {
|
||||
if(guiShowPointer != settings[FPSTR(F_GUI_POINTER)].as<bool>()) {
|
||||
debugPrintln(F("guiShowPointer set"));
|
||||
Log.trace(F("guiShowPointer set"));
|
||||
}
|
||||
changed |= guiShowPointer != settings[FPSTR(F_GUI_POINTER)].as<bool>();
|
||||
|
||||
@ -525,7 +513,7 @@ bool guiSetConfig(const JsonObject & settings)
|
||||
}
|
||||
|
||||
if(status) {
|
||||
debugPrintln(F("calData set"));
|
||||
Log.trace(F("calData set"));
|
||||
guiAutoCalibrate = false;
|
||||
}
|
||||
|
||||
@ -607,16 +595,16 @@ void guiSendBmpHeader()
|
||||
if(guiSnapshot == 1) {
|
||||
size_t len = pFileOut.write(buffer, 122);
|
||||
if(len != sizeof(buffer)) {
|
||||
errorPrintln(F("GUI: %sData written does not match header size"));
|
||||
Log.warning(F("GUI: Data written does not match header size"));
|
||||
} else {
|
||||
debugPrintln(F("GUI: Bitmap header written"));
|
||||
Log.verbose(F("GUI: Bitmap header written"));
|
||||
}
|
||||
|
||||
} else if(guiSnapshot == 2) {
|
||||
if(webClient->client().write(buffer, 122) != 122) {
|
||||
errorPrintln(F("GUI: %sData sent does not match header size"));
|
||||
Log.warning(F("GUI: Data sent does not match header size"));
|
||||
} else {
|
||||
debugPrintln(F("GUI: Bitmap header sent"));
|
||||
Log.verbose(F("GUI: Bitmap header sent"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -633,11 +621,9 @@ void guiSendBmpHeader()
|
||||
void guiTakeScreenshot(const char * pFileName)
|
||||
{
|
||||
pFileOut = SPIFFS.open(pFileName, "w");
|
||||
char buffer[128];
|
||||
|
||||
if(pFileOut == NULL) {
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("[Display] error: %s cannot be opened"), pFileName);
|
||||
debugPrintln(buffer);
|
||||
Log.warning(F("GUI: %s cannot be opened"), pFileName);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -649,8 +635,7 @@ void guiTakeScreenshot(const char * pFileName)
|
||||
guiSnapshot = 0;
|
||||
|
||||
pFileOut.close();
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("[Display] data flushed to %s"), pFileName);
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("[Display] data flushed to %s"), pFileName);
|
||||
}
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
@ -672,5 +657,5 @@ void guiTakeScreenshot(ESP8266WebServer & client)
|
||||
lv_refr_now(NULL); /* Will call our disp_drv.disp_flush function */
|
||||
guiSnapshot = 0;
|
||||
|
||||
debugPrintln(F("GUI: Bitmap data flushed to webclient"));
|
||||
Log.verbose(F("GUI: Bitmap data flushed to webclient"));
|
||||
}
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
#include "hasp_conf.h"
|
||||
|
||||
// #include "hasp_log.h"
|
||||
#include "hasp_gui.h"
|
||||
#include "hasp_hal.h"
|
||||
#include "hasp_debug.h"
|
||||
@ -440,7 +439,6 @@ bool httpSetConfig(const JsonObject & settings)
|
||||
|
||||
#include "hasp_conf.h"
|
||||
|
||||
//#include "hasp_log.h"
|
||||
#include "hasp_gui.h"
|
||||
#include "hasp_hal.h"
|
||||
#include "hasp_debug.h"
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include "hasp_conf.h"
|
||||
|
||||
// #include "hasp_log.h"
|
||||
#include "hasp_mdns.h"
|
||||
#include "hasp_config.h"
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <ESP.h>
|
||||
#endif
|
||||
|
||||
//#include "hasp_log.h"
|
||||
#include "hasp_hal.h"
|
||||
#include "hasp_debug.h"
|
||||
#include "hasp_config.h"
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include <Arduino.h>
|
||||
#include "ArduinoJson.h"
|
||||
#include <ArduinoOTA.h>
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
|
||||
#include "hasp_log.h"
|
||||
#include "hasp_debug.h"
|
||||
#include "hasp_dispatch.h"
|
||||
#include "hasp_ota.h"
|
||||
@ -20,17 +20,15 @@ int16_t otaPort = 3232;
|
||||
|
||||
void otaProgress()
|
||||
{
|
||||
debugPrintln(String(F("OTA: ")) + (ArduinoOTA.getCommand() == U_FLASH ? F("Firmware") : F("Filesystem")) +
|
||||
F(" update in progress... ") + otaPrecentageComplete + "%");
|
||||
Log.verbose(F("OTA: %s update in progress... %3u%"),
|
||||
(ArduinoOTA.getCommand() == U_FLASH ? PSTR("Firmware") : PSTR("Filesystem")), otaPrecentageComplete);
|
||||
}
|
||||
|
||||
void otaSetup(JsonObject settings)
|
||||
{
|
||||
if(!settings[F_OTA_URL].isNull()) {
|
||||
char buffer[128];
|
||||
otaUrl = settings[F_OTA_URL].as<String>().c_str();
|
||||
sprintf_P(buffer, PSTR("ORA url: %s"), otaUrl.c_str());
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("ORA url: %s"), otaUrl.c_str());
|
||||
}
|
||||
|
||||
if(otaPort > 0) {
|
||||
@ -40,8 +38,8 @@ void otaSetup(JsonObject settings)
|
||||
// NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end()
|
||||
}
|
||||
|
||||
debugPrintln(F("OTA: Start update"));
|
||||
dispatchCommand("page 0");
|
||||
Log.notice(F("OTA: Start update"));
|
||||
dispatchPage("0");
|
||||
otaPrecentageComplete = 0;
|
||||
// haspSetAttr("p[0].b[1].txt", "\"ESP OTA Update\"");
|
||||
});
|
||||
@ -60,17 +58,17 @@ void otaSetup(JsonObject settings)
|
||||
});
|
||||
ArduinoOTA.onError([](ota_error_t error) {
|
||||
otaPrecentageComplete = -1;
|
||||
debugPrintln(String(F("OTA: ERROR code ")) + String(error));
|
||||
Log.error(F("OTA: ERROR code %u"), error);
|
||||
if(error == OTA_AUTH_ERROR)
|
||||
debugPrintln(F("OTA: ERROR - Auth Failed"));
|
||||
Log.error(F("OTA: ERROR - Auth Failed"));
|
||||
else if(error == OTA_BEGIN_ERROR)
|
||||
debugPrintln(F("OTA: ERROR - Begin Failed"));
|
||||
Log.error(F("OTA: ERROR - Begin Failed"));
|
||||
else if(error == OTA_CONNECT_ERROR)
|
||||
debugPrintln(F("OTA: ERROR - Connect Failed"));
|
||||
Log.error(F("OTA: ERROR - Connect Failed"));
|
||||
else if(error == OTA_RECEIVE_ERROR)
|
||||
debugPrintln(F("OTA: ERROR - Receive Failed"));
|
||||
Log.error(F("OTA: ERROR - Receive Failed"));
|
||||
else if(error == OTA_END_ERROR)
|
||||
debugPrintln(F("OTA: ERROR - End Failed"));
|
||||
Log.error(F("OTA: ERROR - End Failed"));
|
||||
// haspSetAttr("p[0].b[1].txt", "\"ESP OTA FAILED\"");
|
||||
delay(5000);
|
||||
// haspSendCmd("page " + String(nextionActivePage));
|
||||
@ -95,10 +93,10 @@ void otaSetup(JsonObject settings)
|
||||
ArduinoOTA.setRebootOnSuccess(true);
|
||||
|
||||
ArduinoOTA.begin();
|
||||
debugPrintln(F("OTA: Over the Air firmware update ready"));
|
||||
debugPrintln(F("OTA: Setup Complete"));
|
||||
Log.notice(F("OTA: Over the Air firmware update ready"));
|
||||
Log.verbose(F("OTA: Setup Complete"));
|
||||
} else {
|
||||
debugPrintln(F("OTA: Disabled"));
|
||||
Log.notice(F("OTA: Disabled"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include "ArduinoLog.h"
|
||||
|
||||
#include "hasp_conf.h"
|
||||
//#include "hasp_log.h"
|
||||
#include "hasp_spiffs.h"
|
||||
|
||||
#if HASP_USE_SPIFFS
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
|
||||
#include "hasp_log.h"
|
||||
#include "hasp_debug.h"
|
||||
#include "hasp_config.h"
|
||||
#include "hasp_dispatch.h"
|
||||
@ -34,9 +34,7 @@ bool telnetExitCommand()
|
||||
char buffer[128];
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("exit"));
|
||||
if(strcmp(telnetInputBuffer, buffer) == 0 || telnetLoginAttempt >= 3) {
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("TELNET: Closing session from %s"),
|
||||
telnetClient->remoteIP().toString().c_str());
|
||||
debugPrintln(buffer);
|
||||
Log.notice(F("TELNET: Closing session from %s"), telnetClient->remoteIP().toString().c_str());
|
||||
telnetClient->stop();
|
||||
telnetLoginState = TELNET_UNAUTHENTICATED;
|
||||
telnetInputIndex = 0; // Empty buffer
|
||||
@ -53,10 +51,9 @@ void telnetAcceptClient()
|
||||
telnetClient->stop(); // client disconnected
|
||||
}
|
||||
*telnetClient = telnetServer->available(); // ready for new client
|
||||
Log.notice(F("TELNET: Client connected from %s"), telnetClient->remoteIP().toString().c_str());
|
||||
|
||||
char buffer[128];
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("TELNET: Client connected from %s"),
|
||||
telnetClient->remoteIP().toString().c_str());
|
||||
debugPrintln(buffer);
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("\r\nUsername: "));
|
||||
telnetClient->print(buffer);
|
||||
telnetLoginState = TELNET_UNAUTHENTICATED;
|
||||
@ -109,17 +106,14 @@ void telnetProcessInput()
|
||||
telnetLoginState = TELNET_AUTHENTICATED;
|
||||
telnetLoginAttempt = 0; // Initial attempt
|
||||
telnetClient->println(debugHaspHeader());
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("TELNET: Client login from %s"),
|
||||
telnetClient->remoteIP().toString().c_str());
|
||||
debugPrintln(buffer);
|
||||
Log.notice(F("TELNET: Client login from %s"), telnetClient->remoteIP().toString().c_str());
|
||||
} else {
|
||||
telnetLoginState = TELNET_UNAUTHENTICATED;
|
||||
telnetLoginAttempt++; // Subsequent attempt
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("Authorization failed!\r\n"));
|
||||
telnetClient->println(buffer);
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("TELNET: %%Incorrect login attempt from %s"),
|
||||
telnetClient->remoteIP().toString().c_str());
|
||||
errorPrintln(buffer);
|
||||
Log.warning(F("TELNET: Incorrect login attempt from %s"),
|
||||
telnetClient->remoteIP().toString().c_str());
|
||||
if(telnetLoginAttempt >= 3) {
|
||||
telnetExitCommand();
|
||||
} else {
|
||||
@ -155,9 +149,9 @@ void telnetSetup(const JsonObject & settings)
|
||||
telnetClient = new WiFiClient;
|
||||
telnetServer->setNoDelay(true);
|
||||
telnetServer->begin();
|
||||
debugPrintln(String(F("TELNET: Debug console enabled at telnet://")) + WiFi.localIP().toString());
|
||||
Log.notice(F("TELNET: Debug console enabled at telnet://%s"), WiFi.localIP().toString().c_str());
|
||||
} else {
|
||||
errorPrintln(F("TELNET: %sFailed to start telnet server"));
|
||||
Log.error(F("TELNET: Failed to start telnet server"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,13 @@
|
||||
#include "TFT_eSPI.h" // Graphics and font library for ST7735 driver chip
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
#include "TFT_eSPI.h"
|
||||
|
||||
#include "hasp_tft.h"
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
ADC_MODE(ADC_VCC); // tftShowConfig measures the voltage on the pin
|
||||
#endif
|
||||
|
||||
#include "hasp_log.h"
|
||||
#include "hasp_tft.h"
|
||||
|
||||
#define F_TFT_ROTATION F("rotation")
|
||||
#define F_TFT_FREQUENCY F("frequency")
|
||||
|
||||
int8_t getPinName(int8_t pin);
|
||||
|
||||
void tftSetup(TFT_eSPI & tft, JsonObject settings)
|
||||
@ -62,61 +59,46 @@ String tftDriverName()
|
||||
|
||||
void tftOffsetInfo(uint8_t pin, uint8_t x_offset, uint8_t y_offset)
|
||||
{
|
||||
char buffer[128];
|
||||
if(x_offset != 0) {
|
||||
sprintf_P(buffer, PSTR("TFT: R%u x offset = %i"), pin, x_offset);
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("TFT: R%u x offset = %i"), pin, x_offset);
|
||||
}
|
||||
if(y_offset != 0) {
|
||||
sprintf_P(buffer, PSTR("TFT: R%u y offset = %i"), pin, y_offset);
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("TFT: R%u y offset = %i"), pin, y_offset);
|
||||
}
|
||||
}
|
||||
|
||||
void tftPinInfo(String pinfunction, int8_t pin)
|
||||
{
|
||||
if(pin != -1) {
|
||||
char buffer[128];
|
||||
sprintf_P(buffer, PSTR("TFT: %s = D%i (GPIO %i)"), pinfunction.c_str(), getPinName(pin), pin);
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("TFT: %s = D%i (GPIO %i)"), pinfunction.c_str(), getPinName(pin), pin);
|
||||
}
|
||||
}
|
||||
|
||||
void tftShowConfig(TFT_eSPI & tft)
|
||||
{
|
||||
setup_t tftSetup;
|
||||
char buffer[128];
|
||||
// char buffer[128];
|
||||
tft.getSetup(tftSetup);
|
||||
|
||||
sprintf_P(buffer, PSTR("TFT: TFT_eSPI ver = %s"), tftSetup.version.c_str());
|
||||
debugPrintln(buffer);
|
||||
sprintf_P(buffer, PSTR("TFT: Processor = ESP%x"), tftSetup.esp);
|
||||
debugPrintln(buffer);
|
||||
sprintf_P(buffer, PSTR("TFT: Frequency = %i MHz"), ESP.getCpuFreqMHz());
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("TFT: TFT_eSPI ver = %s"), tftSetup.version.c_str());
|
||||
Log.verbose(F("TFT: Processor = ESP%x"), tftSetup.esp);
|
||||
Log.verbose(F("TFT: Frequency = %i MHz"), ESP.getCpuFreqMHz());
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
sprintf_P(buffer, PSTR("TFT: Voltage = %2.2f V"), ESP.getVcc() / 918.0);
|
||||
debugPrintln(buffer); // 918 empirically determined
|
||||
Log.verbose(F("TFT: Voltage = %2.2f V"), ESP.getVcc() / 918.0); // 918 empirically determined
|
||||
#endif
|
||||
sprintf_P(buffer, PSTR("TFT: Transactions = %s"), (tftSetup.trans == 1) ? PSTR("Yes") : PSTR("No"));
|
||||
debugPrintln(buffer);
|
||||
sprintf_P(buffer, PSTR("TFT: Interface = %s"), (tftSetup.serial == 1) ? PSTR("SPI") : PSTR("Parallel"));
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("TFT: Transactions = %s"), (tftSetup.trans == 1) ? PSTR("Yes") : PSTR("No"));
|
||||
Log.verbose(F("TFT: Interface = %s"), (tftSetup.serial == 1) ? PSTR("SPI") : PSTR("Parallel"));
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
sprintf_P(buffer, PSTR("TFT: SPI overlap = %s"), (tftSetup.overlap == 1) ? PSTR("Yes") : PSTR("No"));
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("TFT: SPI overlap = %s"), (tftSetup.overlap == 1) ? PSTR("Yes") : PSTR("No"));
|
||||
#endif
|
||||
if(tftSetup.tft_driver != 0xE9D) // For ePaper displays the size is defined in the sketch
|
||||
{
|
||||
sprintf_P(buffer, PSTR("TFT: Display driver = %s"), tftDriverName().c_str()); // tftSetup.tft_driver);
|
||||
debugPrintln(buffer);
|
||||
sprintf_P(buffer, PSTR("TFT: Display width = %i"), tftSetup.tft_width);
|
||||
debugPrintln(buffer);
|
||||
sprintf_P(buffer, PSTR("TFT: Display height = %i"), tftSetup.tft_height);
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("TFT: Display driver = %s"), tftDriverName().c_str()); // tftSetup.tft_driver);
|
||||
Log.verbose(F("TFT: Display width = %i"), tftSetup.tft_width);
|
||||
Log.verbose(F("TFT: Display height = %i"), tftSetup.tft_height);
|
||||
} else if(tftSetup.tft_driver == 0xE9D)
|
||||
debugPrintln(F("Display driver = ePaper"));
|
||||
Log.verbose(F("Display driver = ePaper"));
|
||||
|
||||
// Offsets, not all used yet
|
||||
tftOffsetInfo(0, tftSetup.r0_x_offset, tftSetup.r0_y_offset);
|
||||
@ -138,14 +120,14 @@ void tftShowConfig(TFT_eSPI & tft)
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
if(tftSetup.overlap == true) {
|
||||
debugPrintln(F("Overlap selected, following pins MUST be used:\n"));
|
||||
Log.verbose(F("Overlap selected, following pins MUST be used:"));
|
||||
|
||||
debugPrintln(F("MOSI = SD1 (GPIO 8)"));
|
||||
debugPrintln(F("MISO = SD0 (GPIO 7)"));
|
||||
debugPrintln(F("SCK = CLK (GPIO 6)"));
|
||||
debugPrintln(F("TFT_CS = D3 (GPIO 0)"));
|
||||
Log.verbose(F("MOSI = SD1 (GPIO 8)"));
|
||||
Log.verbose(F("MISO = SD0 (GPIO 7)"));
|
||||
Log.verbose(F("SCK = CLK (GPIO 6)"));
|
||||
Log.verbose(F("TFT_CS = D3 (GPIO 0)"));
|
||||
|
||||
debugPrintln(F("TFT_DC and TFT_RST pins can be tftSetup defined\n"));
|
||||
Log.verbose(F("TFT_DC and TFT_RST pins can be tftSetup defined"));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -169,25 +151,23 @@ void tftShowConfig(TFT_eSPI & tft)
|
||||
|
||||
/*
|
||||
uint16_t fonts = tft.fontsLoaded();
|
||||
if(fonts & (1 << 1)) debugPrintln(F("Font GLCD loaded\n"));
|
||||
if(fonts & (1 << 2)) debugPrintln(F("Font 2 loaded\n"));
|
||||
if(fonts & (1 << 4)) debugPrintln(F("Font 4 loaded\n"));
|
||||
if(fonts & (1 << 6)) debugPrintln(F("Font 6 loaded\n"));
|
||||
if(fonts & (1 << 7)) debugPrintln(F("Font 7 loaded\n"));
|
||||
if(fonts & (1 << 1)) Log.verbose(F("Font GLCD loaded\n"));
|
||||
if(fonts & (1 << 2)) Log.verbose(F("Font 2 loaded\n"));
|
||||
if(fonts & (1 << 4)) Log.verbose(F("Font 4 loaded\n"));
|
||||
if(fonts & (1 << 6)) Log.verbose(F("Font 6 loaded\n"));
|
||||
if(fonts & (1 << 7)) Log.verbose(F("Font 7 loaded\n"));
|
||||
if(fonts & (1 << 9))
|
||||
debugPrintln(F("Font 8N loaded\n"));
|
||||
Log.verbose(F("Font 8N loaded\n"));
|
||||
else if(fonts & (1 << 8))
|
||||
debugPrintln(F("Font 8 loaded\n"));
|
||||
if(fonts & (1 << 15)) debugPrintln(F("Smooth font enabled\n"));
|
||||
Log.verbose(F("Font 8 loaded\n"));
|
||||
if(fonts & (1 << 15)) Log.verbose(F("Smooth font enabled\n"));
|
||||
*/
|
||||
|
||||
if(tftSetup.serial == 1) {
|
||||
sprintf_P(buffer, PSTR("TFT: Display SPI frequency = %2.1f MHz"), tftSetup.tft_spi_freq / 10.0);
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("TFT: Display SPI frequency = %2.1f MHz"), tftSetup.tft_spi_freq / 10.0);
|
||||
}
|
||||
if(tftSetup.pin_tch_cs != -1) {
|
||||
sprintf_P(buffer, PSTR("TFT: Touch SPI frequency = %2.1f MHz"), tftSetup.tch_spi_freq / 10.0);
|
||||
debugPrintln(buffer);
|
||||
Log.verbose(F("TFT: Touch SPI frequency = %2.1f MHz"), tftSetup.tch_spi_freq / 10.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "hasp_wifi.h"
|
||||
#include "hasp_http.h"
|
||||
#include "hasp_mdns.h"
|
||||
//#include "hasp_log.h"
|
||||
#include "hasp_debug.h"
|
||||
#include "hasp_config.h"
|
||||
#include "hasp_dispatch.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user