mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-02 01:10:38 +08:00
Add MKS TFT support
This commit is contained in:
parent
82f0c74015
commit
1d7b3ff83f
@ -1935,7 +1935,29 @@ bool COMMAND::check_command (String buffer, tpipe output, bool handlelockserial,
|
|||||||
#ifdef SERIAL_COMMAND_FEATURE
|
#ifdef SERIAL_COMMAND_FEATURE
|
||||||
if (executecmd) {
|
if (executecmd) {
|
||||||
String ESP_Command;
|
String ESP_Command;
|
||||||
int ESPpos = buffer.indexOf ("[ESP");
|
int ESPpos = -1;
|
||||||
|
#ifdef MKS_TFT_FEATURE
|
||||||
|
if (buffer.startsWith("at+")){
|
||||||
|
//echo
|
||||||
|
ESPCOM::print (buffer, output);
|
||||||
|
ESPCOM::print ("\r\r\n", output);
|
||||||
|
if (buffer.startsWith("at+net_wanip=?")){
|
||||||
|
String ipstr;
|
||||||
|
if (WiFi.getMode() == WIFI_STA) {
|
||||||
|
ipstr = WiFi.localIP().toString() + "," + WiFi.subnetMask().toString()+ "," + WiFi.gatewayIP().toString()+"\r\n";
|
||||||
|
} else {
|
||||||
|
ipstr = WiFi.softAPIP().toString() + ",255.255.255.0," + WiFi.softAPIP().toString()+"\r\n";
|
||||||
|
}
|
||||||
|
ESPCOM::print (ipstr, output);
|
||||||
|
} else if (buffer.startsWith("at+wifi_ConState=?")){
|
||||||
|
ESPCOM::print ("Connected\r\n", output);
|
||||||
|
} else{
|
||||||
|
ESPCOM::print ("ok\r\n", output);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
ESPpos = buffer.indexOf ("[ESP");
|
||||||
if (ESPpos == -1 && (CONFIG::GetFirmwareTarget() == SMOOTHIEWARE)){
|
if (ESPpos == -1 && (CONFIG::GetFirmwareTarget() == SMOOTHIEWARE)){
|
||||||
ESPpos = buffer.indexOf ("[esp");
|
ESPpos = buffer.indexOf ("[esp");
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//version and sources location
|
//version and sources location
|
||||||
#define FW_VERSION "2.1.0.b27"
|
#define FW_VERSION "2.1.0.b28"
|
||||||
#define REPOSITORY "https://github.com/luc-github/ESP3D"
|
#define REPOSITORY "https://github.com/luc-github/ESP3D"
|
||||||
|
|
||||||
//Customize ESP3D ////////////////////////////////////////////////////////////////////////
|
//Customize ESP3D ////////////////////////////////////////////////////////////////////////
|
||||||
@ -51,6 +51,9 @@
|
|||||||
//NOTIFICATION_FEATURE : allow to push notifications
|
//NOTIFICATION_FEATURE : allow to push notifications
|
||||||
#define NOTIFICATION_FEATURE
|
#define NOTIFICATION_FEATURE
|
||||||
|
|
||||||
|
//MKS TFT WIFI support see Wiki for wiring
|
||||||
|
//#define MKS_TFT_FEATURE
|
||||||
|
|
||||||
//MDNS_FEATURE: this feature allow type the name defined
|
//MDNS_FEATURE: this feature allow type the name defined
|
||||||
//in web browser by default: http:\\esp8266.local and connect
|
//in web browser by default: http:\\esp8266.local and connect
|
||||||
#define MDNS_FEATURE
|
#define MDNS_FEATURE
|
||||||
|
@ -121,6 +121,9 @@ void Esp3D::begin(uint16_t startdelayms, uint16_t recoverydelayms)
|
|||||||
data_server = NULL;
|
data_server = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MKS_TFT_FEATURE
|
||||||
|
startdelayms = 1000;
|
||||||
|
#endif
|
||||||
#ifdef ESP_OLED_FEATURE
|
#ifdef ESP_OLED_FEATURE
|
||||||
uint32_t start_display_time = millis();
|
uint32_t start_display_time = millis();
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
|
@ -179,7 +179,9 @@ void onWiFiEvent(WiFiEvent_t event){
|
|||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case WIFI_EVENT_STAMODE_CONNECTED:
|
case WIFI_EVENT_STAMODE_CONNECTED:
|
||||||
|
#ifndef MKS_TFT_FEATURE
|
||||||
ESPCOM::println (F ("Connected"), PRINTER_PIPE);
|
ESPCOM::println (F ("Connected"), PRINTER_PIPE);
|
||||||
|
#endif
|
||||||
#ifdef ESP_OLED_FEATURE
|
#ifdef ESP_OLED_FEATURE
|
||||||
OLED_DISPLAY::display_signal(wifi_config.getSignal (WiFi.RSSI ()));
|
OLED_DISPLAY::display_signal(wifi_config.getSignal (WiFi.RSSI ()));
|
||||||
OLED_DISPLAY::setCursor(0, 0);
|
OLED_DISPLAY::setCursor(0, 0);
|
||||||
@ -196,7 +198,9 @@ void onWiFiEvent(WiFiEvent_t event){
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case WIFI_EVENT_STAMODE_GOT_IP:
|
case WIFI_EVENT_STAMODE_GOT_IP:
|
||||||
|
#ifndef MKS_TFT_FEATURE
|
||||||
ESPCOM::println (WiFi.localIP().toString().c_str(), PRINTER_PIPE);
|
ESPCOM::println (WiFi.localIP().toString().c_str(), PRINTER_PIPE);
|
||||||
|
#endif
|
||||||
#ifdef ESP_OLED_FEATURE
|
#ifdef ESP_OLED_FEATURE
|
||||||
OLED_DISPLAY::setCursor(0, 16);
|
OLED_DISPLAY::setCursor(0, 16);
|
||||||
ESPCOM::print(WiFi.localIP().toString().c_str(), OLED_PIPE);
|
ESPCOM::print(WiFi.localIP().toString().c_str(), OLED_PIPE);
|
||||||
@ -273,9 +277,12 @@ bool WIFI_CONFIG::Setup (bool force_ap)
|
|||||||
#ifdef ESP_OLED_FEATURE
|
#ifdef ESP_OLED_FEATURE
|
||||||
OLED_DISPLAY::display_signal(100);
|
OLED_DISPLAY::display_signal(100);
|
||||||
OLED_DISPLAY::setCursor(0, 0);
|
OLED_DISPLAY::setCursor(0, 0);
|
||||||
|
|
||||||
ESPCOM::print(sbuf, OLED_PIPE);
|
ESPCOM::print(sbuf, OLED_PIPE);
|
||||||
#else
|
#else
|
||||||
|
#ifndef MKS_TFT_FEATURE
|
||||||
ESPCOM::println (sbuf, PRINTER_PIPE);
|
ESPCOM::println (sbuf, PRINTER_PIPE);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
LOG ("SSID ")
|
LOG ("SSID ")
|
||||||
LOG (sbuf)
|
LOG (sbuf)
|
||||||
@ -411,7 +418,9 @@ bool WIFI_CONFIG::Setup (bool force_ap)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef MKS_TFT_FEATURE
|
||||||
ESPCOM::println (sbuf, PRINTER_PIPE);
|
ESPCOM::println (sbuf, PRINTER_PIPE);
|
||||||
|
#endif
|
||||||
#ifdef ESP_OLED_FEATURE
|
#ifdef ESP_OLED_FEATURE
|
||||||
OLED_DISPLAY::display_signal(-1);
|
OLED_DISPLAY::display_signal(-1);
|
||||||
OLED_DISPLAY::setCursor(0, 0);
|
OLED_DISPLAY::setCursor(0, 0);
|
||||||
@ -512,13 +521,17 @@ bool WIFI_CONFIG::Setup (bool force_ap)
|
|||||||
if (dot == 4) {
|
if (dot == 4) {
|
||||||
dot = 0;
|
dot = 0;
|
||||||
}
|
}
|
||||||
|
#ifndef MKS_TFT_FEATURE
|
||||||
ESPCOM::println (msg, PRINTER_PIPE);
|
ESPCOM::println (msg, PRINTER_PIPE);
|
||||||
|
#endif
|
||||||
|
|
||||||
delay (500);
|
delay (500);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (WiFi.status() != WL_CONNECTED) {
|
if (WiFi.status() != WL_CONNECTED) {
|
||||||
|
#ifndef MKS_TFT_FEATURE
|
||||||
ESPCOM::println (F ("Not Connected!"), PRINTER_PIPE);
|
ESPCOM::println (F ("Not Connected!"), PRINTER_PIPE);
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#ifdef ARDUINO_ARCH_ESP8266
|
#ifdef ARDUINO_ARCH_ESP8266
|
||||||
|
Loading…
x
Reference in New Issue
Block a user