🔧 Fix up WiFi options (#25586)
This commit is contained in:
@@ -50,15 +50,13 @@
|
|||||||
|
|
||||||
#define MYSERIAL1 flushableSerial
|
#define MYSERIAL1 flushableSerial
|
||||||
|
|
||||||
#if EITHER(WIFISUPPORT, ESP3D_WIFISUPPORT)
|
|
||||||
#if ENABLED(ESP3D_WIFISUPPORT)
|
#if ENABLED(ESP3D_WIFISUPPORT)
|
||||||
typedef ForwardSerial1Class< decltype(Serial2Socket) > DefaultSerial1;
|
typedef ForwardSerial1Class< decltype(Serial2Socket) > DefaultSerial1;
|
||||||
extern DefaultSerial1 MSerial0;
|
extern DefaultSerial1 MSerial0;
|
||||||
#define MYSERIAL2 MSerial0
|
#define MYSERIAL2 MSerial0
|
||||||
#else
|
#elif ENABLED(WIFISUPPORT)
|
||||||
#define MYSERIAL2 webSocketSerial
|
#define MYSERIAL2 webSocketSerial
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CRITICAL_SECTION_START() portENTER_CRITICAL(&hal.spinlock)
|
#define CRITICAL_SECTION_START() portENTER_CRITICAL(&hal.spinlock)
|
||||||
#define CRITICAL_SECTION_END() portEXIT_CRITICAL(&hal.spinlock)
|
#define CRITICAL_SECTION_END() portEXIT_CRITICAL(&hal.spinlock)
|
||||||
|
@@ -21,6 +21,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
|
|
||||||
#include "Delay.h"
|
#include "Delay.h"
|
||||||
|
|
||||||
void esp_wifi_init(void) { // init ESP01 WIFI module pins
|
void esp_wifi_init(void) { // init ESP01 WIFI module pins
|
||||||
@@ -41,3 +44,5 @@ void esp_wifi_init(void) { // init ESP01 WIFI module pi
|
|||||||
OUT_WRITE(ESP_WIFI_MODULE_ENABLE_PIN, HIGH);
|
OUT_WRITE(ESP_WIFI_MODULE_ENABLE_PIN, HIGH);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // WIFISUPPORT
|
||||||
|
@@ -34,6 +34,10 @@
|
|||||||
#include "HAL/shared/esp_wifi.h"
|
#include "HAL/shared/esp_wifi.h"
|
||||||
#include "HAL/shared/cpu_exception/exception_hook.h"
|
#include "HAL/shared/cpu_exception/exception_hook.h"
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
|
#include "HAL/shared/esp_wifi.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ARDUINO
|
#ifdef ARDUINO
|
||||||
#include <pins_arduino.h>
|
#include <pins_arduino.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -1270,7 +1274,9 @@ void setup() {
|
|||||||
|
|
||||||
SETUP_RUN(hal.init_board());
|
SETUP_RUN(hal.init_board());
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
SETUP_RUN(esp_wifi_init());
|
SETUP_RUN(esp_wifi_init());
|
||||||
|
#endif
|
||||||
|
|
||||||
// Report Reset Reason
|
// Report Reset Reason
|
||||||
if (mcu & RST_POWER_ON) SERIAL_ECHOLNPGM(STR_POWERUP);
|
if (mcu & RST_POWER_ON) SERIAL_ECHOLNPGM(STR_POWERUP);
|
||||||
|
@@ -4307,10 +4307,14 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sanity check for WIFI
|
* Sanity check WiFi options
|
||||||
*/
|
*/
|
||||||
#if EITHER(ESP3D_WIFISUPPORT, WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32)
|
#if ENABLED(ESP3D_WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32)
|
||||||
#error "ESP3D_WIFISUPPORT or WIFISUPPORT requires an ESP32 MOTHERBOARD."
|
#error "ESP3D_WIFISUPPORT requires an ESP32 MOTHERBOARD."
|
||||||
|
#elif ENABLED(WEBSUPPORT) && NONE(ARDUINO_ARCH_ESP32, WIFISUPPORT)
|
||||||
|
#error "WEBSUPPORT requires WIFISUPPORT and an ESP32 MOTHERBOARD."
|
||||||
|
#elif BOTH(ESP3D_WIFISUPPORT, WIFISUPPORT)
|
||||||
|
#error "Enable only one of ESP3D_WIFISUPPORT or WIFISUPPORT."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -163,11 +163,13 @@
|
|||||||
#define TFT_LCD_MODULE_COM 1
|
#define TFT_LCD_MODULE_COM 1
|
||||||
#define TFT_LCD_MODULE_BAUDRATE 115600
|
#define TFT_LCD_MODULE_BAUDRATE 115600
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
// ESP WiFi Use internal USART-2
|
// ESP WiFi Use internal USART-2
|
||||||
#define ESP_WIFI_MODULE_COM 2
|
#define ESP_WIFI_MODULE_COM 2
|
||||||
#define ESP_WIFI_MODULE_BAUDRATE 115600
|
#define ESP_WIFI_MODULE_BAUDRATE 115600
|
||||||
#define ESP_WIFI_MODULE_RESET_PIN -1
|
#define ESP_WIFI_MODULE_RESET_PIN -1
|
||||||
#define PIGGY_GPIO_PIN -1
|
#define PIGGY_GPIO_PIN -1
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// EEPROM
|
// EEPROM
|
||||||
|
@@ -153,11 +153,13 @@
|
|||||||
#define TFT_LCD_MODULE_COM 1
|
#define TFT_LCD_MODULE_COM 1
|
||||||
#define TFT_LCD_MODULE_BAUDRATE 115200
|
#define TFT_LCD_MODULE_BAUDRATE 115200
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
// ESP WiFi Use internal USART-2
|
// ESP WiFi Use internal USART-2
|
||||||
#define ESP_WIFI_MODULE_COM 2
|
#define ESP_WIFI_MODULE_COM 2
|
||||||
#define ESP_WIFI_MODULE_BAUDRATE 115200
|
#define ESP_WIFI_MODULE_BAUDRATE 115200
|
||||||
#define ESP_WIFI_MODULE_RESET_PIN -1
|
#define ESP_WIFI_MODULE_RESET_PIN -1
|
||||||
#define PIGGY_GPIO_PIN -1
|
#define PIGGY_GPIO_PIN -1
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// EEPROM
|
// EEPROM
|
||||||
|
@@ -138,6 +138,7 @@
|
|||||||
#define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 }
|
#define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
/**
|
/**
|
||||||
* MKS Robin_Wifi or another ESP8266 module
|
* MKS Robin_Wifi or another ESP8266 module
|
||||||
*
|
*
|
||||||
@@ -160,6 +161,7 @@
|
|||||||
#define ESP_WIFI_MODULE_TXD_PIN PA9 // MKS or ESP WIFI RX PIN
|
#define ESP_WIFI_MODULE_TXD_PIN PA9 // MKS or ESP WIFI RX PIN
|
||||||
#define ESP_WIFI_MODULE_RXD_PIN PA10 // MKS or ESP WIFI TX PIN
|
#define ESP_WIFI_MODULE_RXD_PIN PA10 // MKS or ESP WIFI TX PIN
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// EXTRUDER
|
// EXTRUDER
|
||||||
|
@@ -226,10 +226,11 @@
|
|||||||
|
|
||||||
#define SDSS SD_SS_PIN
|
#define SDSS SD_SS_PIN
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
//
|
//
|
||||||
// ESP WiFi can be soldered to J9 connector which is wired to USART2.
|
// ESP WiFi can be soldered to J9 connector which is wired to USART2.
|
||||||
// Must define WIFISUPPORT in Configuration.h for the printer.
|
|
||||||
//
|
//
|
||||||
#define ESP_WIFI_MODULE_COM 2
|
#define ESP_WIFI_MODULE_COM 2
|
||||||
#define ESP_WIFI_MODULE_BAUDRATE 115200
|
#define ESP_WIFI_MODULE_BAUDRATE 115200
|
||||||
#define ESP_WIFI_MODULE_RESET_PIN -1
|
#define ESP_WIFI_MODULE_RESET_PIN -1
|
||||||
|
#endif
|
||||||
|
@@ -220,10 +220,11 @@
|
|||||||
|
|
||||||
#define SDSS SD_SS_PIN
|
#define SDSS SD_SS_PIN
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
//
|
//
|
||||||
// ESP WiFi can be soldered to J9 connector which is wired to USART2.
|
// ESP WiFi can be soldered to J9 connector which is wired to USART2.
|
||||||
// Must define WIFISUPPORT in Configuration.h for the printer.
|
|
||||||
//
|
//
|
||||||
#define ESP_WIFI_MODULE_COM 2
|
#define ESP_WIFI_MODULE_COM 2
|
||||||
#define ESP_WIFI_MODULE_BAUDRATE 115200
|
#define ESP_WIFI_MODULE_BAUDRATE 115200
|
||||||
#define ESP_WIFI_MODULE_RESET_PIN -1
|
#define ESP_WIFI_MODULE_RESET_PIN -1
|
||||||
|
#endif
|
||||||
|
@@ -231,10 +231,11 @@
|
|||||||
|
|
||||||
#define SDSS SD_SS_PIN
|
#define SDSS SD_SS_PIN
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
//
|
//
|
||||||
// ESP WiFi can be soldered to J9 connector which is wired to USART2.
|
// ESP WiFi can be soldered to J9 connector which is wired to USART2.
|
||||||
// Must define WIFISUPPORT in Configuration.h for the printer.
|
|
||||||
//
|
//
|
||||||
#define ESP_WIFI_MODULE_COM 2
|
#define ESP_WIFI_MODULE_COM 2
|
||||||
#define ESP_WIFI_MODULE_BAUDRATE 115200
|
#define ESP_WIFI_MODULE_BAUDRATE 115200
|
||||||
#define ESP_WIFI_MODULE_RESET_PIN -1
|
#define ESP_WIFI_MODULE_RESET_PIN -1
|
||||||
|
#endif
|
||||||
|
@@ -223,10 +223,11 @@
|
|||||||
|
|
||||||
#define SDSS SD_SS_PIN
|
#define SDSS SD_SS_PIN
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
//
|
//
|
||||||
// ESP WiFi can be soldered to J9 connector which is wired to USART2.
|
// ESP WiFi can be soldered to J9 connector which is wired to USART2.
|
||||||
// Must define WIFISUPPORT in Configuration.h for the printer.
|
|
||||||
//
|
//
|
||||||
#define ESP_WIFI_MODULE_COM 2
|
#define ESP_WIFI_MODULE_COM 2
|
||||||
#define ESP_WIFI_MODULE_BAUDRATE 115200
|
#define ESP_WIFI_MODULE_BAUDRATE 115200
|
||||||
#define ESP_WIFI_MODULE_RESET_PIN -1
|
#define ESP_WIFI_MODULE_RESET_PIN -1
|
||||||
|
#endif
|
||||||
|
@@ -390,15 +390,16 @@
|
|||||||
#error "SD CUSTOM_CABLE is not compatible with BTT E3 RRF."
|
#error "SD CUSTOM_CABLE is not compatible with BTT E3 RRF."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
//
|
//
|
||||||
// WIFI
|
// WIFI
|
||||||
//
|
//
|
||||||
|
|
||||||
#define ESP_WIFI_MODULE_COM 3 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this
|
#define ESP_WIFI_MODULE_COM 3 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this
|
||||||
#define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2
|
#define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2
|
||||||
#define ESP_WIFI_MODULE_RESET_PIN PA4
|
#define ESP_WIFI_MODULE_RESET_PIN PA4
|
||||||
#define ESP_WIFI_MODULE_ENABLE_PIN PA5
|
#define ESP_WIFI_MODULE_ENABLE_PIN PA5
|
||||||
#define ESP_WIFI_MODULE_GPIO0_PIN PA6
|
#define ESP_WIFI_MODULE_GPIO0_PIN PA6
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ENABLED(BTT_E3_RRF_IDEX_BOARD)
|
#if ENABLED(BTT_E3_RRF_IDEX_BOARD)
|
||||||
#define FPC2_PIN PB11
|
#define FPC2_PIN PB11
|
||||||
|
@@ -542,6 +542,7 @@
|
|||||||
#define NEOPIXEL_PIN PB0
|
#define NEOPIXEL_PIN PB0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
//
|
//
|
||||||
// WIFI
|
// WIFI
|
||||||
//
|
//
|
||||||
@@ -565,3 +566,4 @@
|
|||||||
#define ESP_WIFI_MODULE_ENABLE_PIN PG8
|
#define ESP_WIFI_MODULE_ENABLE_PIN PG8
|
||||||
#define ESP_WIFI_MODULE_GPIO0_PIN PD7
|
#define ESP_WIFI_MODULE_GPIO0_PIN PD7
|
||||||
#define ESP_WIFI_MODULE_GPIO4_PIN PD10
|
#define ESP_WIFI_MODULE_GPIO4_PIN PD10
|
||||||
|
#endif
|
||||||
|
@@ -545,6 +545,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
//
|
//
|
||||||
// WIFI
|
// WIFI
|
||||||
//
|
//
|
||||||
@@ -564,3 +565,4 @@
|
|||||||
#define ESP_WIFI_MODULE_ENABLE_PIN PG1
|
#define ESP_WIFI_MODULE_ENABLE_PIN PG1
|
||||||
#define ESP_WIFI_MODULE_GPIO0_PIN PF14
|
#define ESP_WIFI_MODULE_GPIO0_PIN PF14
|
||||||
#define ESP_WIFI_MODULE_GPIO2_PIN PF15
|
#define ESP_WIFI_MODULE_GPIO2_PIN PF15
|
||||||
|
#endif
|
||||||
|
@@ -554,6 +554,7 @@
|
|||||||
#define NEOPIXEL_PIN PE6
|
#define NEOPIXEL_PIN PE6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
//
|
//
|
||||||
// WIFI
|
// WIFI
|
||||||
//
|
//
|
||||||
@@ -576,3 +577,4 @@
|
|||||||
#define ESP_WIFI_MODULE_RESET_PIN PC14
|
#define ESP_WIFI_MODULE_RESET_PIN PC14
|
||||||
#define ESP_WIFI_MODULE_GPIO0_PIN PB10
|
#define ESP_WIFI_MODULE_GPIO0_PIN PB10
|
||||||
#define ESP_WIFI_MODULE_GPIO4_PIN PB11
|
#define ESP_WIFI_MODULE_GPIO4_PIN PB11
|
||||||
|
#endif
|
||||||
|
@@ -519,6 +519,7 @@
|
|||||||
#define NEOPIXEL2_PIN PE9
|
#define NEOPIXEL2_PIN PE9
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
//
|
//
|
||||||
// WIFI
|
// WIFI
|
||||||
//
|
//
|
||||||
@@ -541,3 +542,4 @@
|
|||||||
#define ESP_WIFI_MODULE_RESET_PIN PB2
|
#define ESP_WIFI_MODULE_RESET_PIN PB2
|
||||||
#define ESP_WIFI_MODULE_GPIO0_PIN PG0
|
#define ESP_WIFI_MODULE_GPIO0_PIN PG0
|
||||||
#define ESP_WIFI_MODULE_GPIO4_PIN PF15
|
#define ESP_WIFI_MODULE_GPIO4_PIN PF15
|
||||||
|
#endif
|
||||||
|
@@ -541,6 +541,7 @@
|
|||||||
#define NEOPIXEL_PIN PE6
|
#define NEOPIXEL_PIN PE6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(WIFISUPPORT)
|
||||||
//
|
//
|
||||||
// WIFI
|
// WIFI
|
||||||
//
|
//
|
||||||
@@ -563,3 +564,4 @@
|
|||||||
#define ESP_WIFI_MODULE_RESET_PIN PC14
|
#define ESP_WIFI_MODULE_RESET_PIN PC14
|
||||||
#define ESP_WIFI_MODULE_GPIO0_PIN PB10
|
#define ESP_WIFI_MODULE_GPIO0_PIN PB10
|
||||||
#define ESP_WIFI_MODULE_GPIO4_PIN PB11
|
#define ESP_WIFI_MODULE_GPIO4_PIN PB11
|
||||||
|
#endif
|
||||||
|
Reference in New Issue
Block a user