Merge branch '0.2.0' of https://github.com/fvanroie/hasp-lvgl into 0.2.0

This commit is contained in:
fvanroie 2020-11-22 17:00:03 +01:00
commit 24c89ef5b6
4 changed files with 27 additions and 9 deletions

View File

@ -19,10 +19,11 @@ void EthernetEvent(WiFiEvent_t event)
case SYSTEM_EVENT_ETH_START:
Log.notice(TAG_ETH, F("Started"));
// set eth hostname here
ETH.setHostname("esp32-ethernet");
ETH.setHostname(mqttGetNodename().c_str());
break;
case SYSTEM_EVENT_ETH_CONNECTED:
Log.notice(TAG_ETH, F("Connected"));
eth_connected = true;
break;
case SYSTEM_EVENT_ETH_GOT_IP:
Log.notice(TAG_ETH, F("MAC Address %s"), ETH.macAddress().c_str());
@ -60,7 +61,7 @@ void ethernetLoop(void)
bool ethernetEvery5Seconds()
{
Log.warning(TAG_ETH, eth_connected ? F("ONLINE") : F("OFFLINE"));
// Log.warning(TAG_ETH, eth_connected ? F("ONLINE") : F("OFFLINE"));
return eth_connected;
}

View File

@ -106,8 +106,8 @@ bool guiCheckSleep()
return (guiSleeping != HASP_SLEEP_OFF);
}
/* Experimental Display flushing */
static void IRAM_ATTR my_flush_cb(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p)
/* After flusing to the file stream or web client, we also send the buffer to the tft */
static void IRAM_ATTR printscreen_flush_cb(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p)
{
#if 0
size_t len = (area->x2 - area->x1 + 1) * (area->y2 - area->y1 + 1); /* Number of pixels */
@ -131,7 +131,7 @@ static void IRAM_ATTR my_flush_cb(lv_disp_drv_t * disp, const lv_area_t * area,
#endif
/* Tell lvgl that flushing is done */
// lv_disp_flush_ready(disp);
// lv_disp_flush_ready(disp); ===> moved into the drivers
}
/* Interrupt driven periodic handler */
@ -915,7 +915,7 @@ static void gui_screenshot_to_file(lv_disp_drv_t * disp, const lv_area_t * area,
len *= sizeof(lv_color_t); /* Number of bytes */
size_t res = pFileOut.write((uint8_t *)color_p, len);
if(res != len) gui_flush_not_complete();
my_flush_cb(disp, area, color_p);
printscreen_flush_cb(disp, area, color_p);
}
/** Take Screenshot.
@ -969,7 +969,7 @@ static void gui_screenshot_to_http(lv_disp_drv_t * disp, const lv_area_t * area,
len *= sizeof(lv_color_t); /* Number of bytes */
size_t res = httpClientWrite((uint8_t *)color_p, len);
if(res != len) gui_flush_not_complete();
my_flush_cb(disp, area, color_p);
printscreen_flush_cb(disp, area, color_p);
}
/** Take Screenshot.

View File

@ -504,7 +504,24 @@ void webHandleInfo()
httpMessage += String(WiFi.macAddress());
#endif
#endif
#if HASP_USE_ETHERNET > 0
#if defined(ARDUINO_ARCH_ESP32)
httpMessage += F("</p/><p><b>Ethernet: </b>");
httpMessage += String(ETH.linkSpeed());
httpMessage += F(" Mbps");
if(ETH.fullDuplex()) {
httpMessage += F(" FULL_DUPLEX");
}
httpMessage += F("</br><b>IP Address: </b>");
httpMessage += String(ETH.localIP().toString());
httpMessage += F("</br><b>Gateway: </b>");
httpMessage += String(ETH.gatewayIP().toString());
httpMessage += F("</br><b>DNS Server: </b>");
httpMessage += String(ETH.dnsIP().toString());
httpMessage += F("</br><b>MAC Address: </b>");
httpMessage += String(ETH.macAddress());
#endif
#endif
/* Mqtt Stats */
#if HASP_USE_MQTT > 0
httpMessage += F("</p/><p><b>MQTT Status: </b>");

View File

@ -484,7 +484,7 @@ void mqttStop()
size_t len;
snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstatus"), mqttNodeTopic);
len = snprintf_P(tmp_payload, sizeof(tmp_payload), PSTR("OFF"), mqttNodeTopic);
len = snprintf_P(tmp_payload, sizeof(tmp_payload), PSTR("OFF"));
mqttPublish(tmp_topic, tmp_payload, len);
mqttClient.disconnect();