From a14d9e1e01bba563b1b16c916db3912f1dbb4b67 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Mar 2023 16:14:37 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fix=20up=20WiFi=20options=20(#25?= =?UTF-8?q?586)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/ESP32/HAL.h | 14 +++--- Marlin/src/HAL/shared/esp_wifi.cpp | 5 ++ Marlin/src/MarlinCore.cpp | 8 +++- Marlin/src/inc/SanityCheck.h | 10 ++-- Marlin/src/pins/sam/pins_RURAMPS4D_11.h | 12 +++-- Marlin/src/pins/sam/pins_RURAMPS4D_13.h | 12 +++-- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 44 +++++++++--------- Marlin/src/pins/stm32f1/pins_GTM32_MINI.h | 15 +++--- Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h | 15 +++--- Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h | 15 +++--- Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h | 15 +++--- Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h | 19 ++++---- .../pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h | 46 ++++++++++--------- .../pins/stm32f4/pins_BTT_SKR_PRO_common.h | 38 +++++++-------- .../pins/stm32f4/pins_BTT_SKR_V2_0_common.h | 44 +++++++++--------- .../pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h | 44 +++++++++--------- .../pins/stm32h7/pins_BTT_SKR_V3_0_common.h | 44 +++++++++--------- 17 files changed, 217 insertions(+), 183 deletions(-) diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index ddfedf92eed9..5dc9b2cfe2e8 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -50,14 +50,12 @@ #define MYSERIAL1 flushableSerial -#if EITHER(WIFISUPPORT, ESP3D_WIFISUPPORT) - #if ENABLED(ESP3D_WIFISUPPORT) - typedef ForwardSerial1Class< decltype(Serial2Socket) > DefaultSerial1; - extern DefaultSerial1 MSerial0; - #define MYSERIAL2 MSerial0 - #else - #define MYSERIAL2 webSocketSerial - #endif +#if ENABLED(ESP3D_WIFISUPPORT) + typedef ForwardSerial1Class< decltype(Serial2Socket) > DefaultSerial1; + extern DefaultSerial1 MSerial0; + #define MYSERIAL2 MSerial0 +#elif ENABLED(WIFISUPPORT) + #define MYSERIAL2 webSocketSerial #endif #define CRITICAL_SECTION_START() portENTER_CRITICAL(&hal.spinlock) diff --git a/Marlin/src/HAL/shared/esp_wifi.cpp b/Marlin/src/HAL/shared/esp_wifi.cpp index a55f5ca39f91..8a6ac2dfa955 100644 --- a/Marlin/src/HAL/shared/esp_wifi.cpp +++ b/Marlin/src/HAL/shared/esp_wifi.cpp @@ -21,6 +21,9 @@ */ #include "../../inc/MarlinConfig.h" + +#if ENABLED(WIFISUPPORT) + #include "Delay.h" 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); #endif } + +#endif // WIFISUPPORT diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 8c11c39f79b3..a24c41cd82b8 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -34,6 +34,10 @@ #include "HAL/shared/esp_wifi.h" #include "HAL/shared/cpu_exception/exception_hook.h" +#if ENABLED(WIFISUPPORT) + #include "HAL/shared/esp_wifi.h" +#endif + #ifdef ARDUINO #include #endif @@ -1268,7 +1272,9 @@ void setup() { SETUP_RUN(hal.init_board()); - SETUP_RUN(esp_wifi_init()); + #if ENABLED(WIFISUPPORT) + SETUP_RUN(esp_wifi_init()); + #endif // Report Reset Reason if (mcu & RST_POWER_ON) SERIAL_ECHOLNPGM(STR_POWERUP); diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 3db20987780c..69c7a0b83603 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -4166,10 +4166,14 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #endif /** - * Sanity check for WIFI + * Sanity check WiFi options */ -#if EITHER(ESP3D_WIFISUPPORT, WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32) - #error "ESP3D_WIFISUPPORT or WIFISUPPORT requires an ESP32 MOTHERBOARD." +#if ENABLED(ESP3D_WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32) + #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 /** diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index f8ea65a36973..35279bf2e513 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -163,11 +163,13 @@ #define TFT_LCD_MODULE_COM 1 #define TFT_LCD_MODULE_BAUDRATE 115600 -// ESP WiFi Use internal USART-2 -#define ESP_WIFI_MODULE_COM 2 -#define ESP_WIFI_MODULE_BAUDRATE 115600 -#define ESP_WIFI_MODULE_RESET_PIN -1 -#define PIGGY_GPIO_PIN -1 +#if ENABLED(WIFISUPPORT) + // ESP WiFi Use internal USART-2 + #define ESP_WIFI_MODULE_COM 2 + #define ESP_WIFI_MODULE_BAUDRATE 115600 + #define ESP_WIFI_MODULE_RESET_PIN -1 + #define PIGGY_GPIO_PIN -1 +#endif // // EEPROM diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index 58cb3f7a75e9..78cf3f6e1065 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -153,11 +153,13 @@ #define TFT_LCD_MODULE_COM 1 #define TFT_LCD_MODULE_BAUDRATE 115200 -// ESP WiFi Use internal USART-2 -#define ESP_WIFI_MODULE_COM 2 -#define ESP_WIFI_MODULE_BAUDRATE 115200 -#define ESP_WIFI_MODULE_RESET_PIN -1 -#define PIGGY_GPIO_PIN -1 +#if ENABLED(WIFISUPPORT) + // ESP WiFi Use internal USART-2 + #define ESP_WIFI_MODULE_COM 2 + #define ESP_WIFI_MODULE_BAUDRATE 115200 + #define ESP_WIFI_MODULE_RESET_PIN -1 + #define PIGGY_GPIO_PIN -1 +#endif // // EEPROM diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index ff588f948812..c6b65962a5d1 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -138,27 +138,29 @@ #define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 } #endif - /** - * MKS Robin_Wifi or another ESP8266 module - * - * __ESP(M1)__ -J1- - * GND| 15 | | 08 |+3v3 (22) RXD1 (PA10) - * | 16 | | 07 |MOSI (21) TXD1 (PA9) Active LOW, probably OK to leave floating - * IO2| 17 | | 06 |MISO (19) IO1 (PC7) Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) - * IO0| 18 | | 05 |CLK (18) IO0 (PA8) Must be HIGH (ESP3D software configures this with a pullup so OK to leave as floating) - * IO1| 19 | | 03 |EN (03) WIFI_EN Must be HIGH for module to run - * | nc | | nc | (01) WIFI_CTRL (PA5) - * RX| 21 | | nc | - * TX| 22 | | 01 |RST - *  ̄ ̄ AE ̄ ̄ - */ - // Module ESP-WIFI - #define ESP_WIFI_MODULE_COM 2 // 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_RESET_PIN PA5 // WIFI CTRL/RST - #define ESP_WIFI_MODULE_ENABLE_PIN -1 - #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 + #if ENABLED(WIFISUPPORT) + /** + * MKS Robin_Wifi or another ESP8266 module + * + * __ESP(M1)__ -J1- + * GND| 15 | | 08 |+3v3 (22) RXD1 (PA10) + * | 16 | | 07 |MOSI (21) TXD1 (PA9) Active LOW, probably OK to leave floating + * IO2| 17 | | 06 |MISO (19) IO1 (PC7) Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) + * IO0| 18 | | 05 |CLK (18) IO0 (PA8) Must be HIGH (ESP3D software configures this with a pullup so OK to leave as floating) + * IO1| 19 | | 03 |EN (03) WIFI_EN Must be HIGH for module to run + * | nc | | nc | (01) WIFI_CTRL (PA5) + * RX| 21 | | nc | + * TX| 22 | | 01 |RST + *  ̄ ̄ AE ̄ ̄ + */ + // Module ESP-WIFI + #define ESP_WIFI_MODULE_COM 2 // 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_RESET_PIN PA5 // WIFI CTRL/RST + #define ESP_WIFI_MODULE_ENABLE_PIN -1 + #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 + #endif #endif // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h index 5515132c7844..24981cda61f4 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h @@ -226,10 +226,11 @@ #define SDSS SD_SS_PIN -// -// 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_BAUDRATE 115200 -#define ESP_WIFI_MODULE_RESET_PIN -1 +#if ENABLED(WIFISUPPORT) + // + // ESP WiFi can be soldered to J9 connector which is wired to USART2. + // + #define ESP_WIFI_MODULE_COM 2 + #define ESP_WIFI_MODULE_BAUDRATE 115200 + #define ESP_WIFI_MODULE_RESET_PIN -1 +#endif diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h index dc23680b8c20..cbe23356e38b 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h @@ -220,10 +220,11 @@ #define SDSS SD_SS_PIN -// -// 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_BAUDRATE 115200 -#define ESP_WIFI_MODULE_RESET_PIN -1 +#if ENABLED(WIFISUPPORT) + // + // ESP WiFi can be soldered to J9 connector which is wired to USART2. + // + #define ESP_WIFI_MODULE_COM 2 + #define ESP_WIFI_MODULE_BAUDRATE 115200 + #define ESP_WIFI_MODULE_RESET_PIN -1 +#endif diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h index 646638dae2f5..1418340d2dcf 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h @@ -231,10 +231,11 @@ #define SDSS SD_SS_PIN -// -// 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_BAUDRATE 115200 -#define ESP_WIFI_MODULE_RESET_PIN -1 +#if ENABLED(WIFISUPPORT) + // + // ESP WiFi can be soldered to J9 connector which is wired to USART2. + // + #define ESP_WIFI_MODULE_COM 2 + #define ESP_WIFI_MODULE_BAUDRATE 115200 + #define ESP_WIFI_MODULE_RESET_PIN -1 +#endif diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h index 968d9cb6bd58..22ff91aeac45 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h @@ -223,10 +223,11 @@ #define SDSS SD_SS_PIN -// -// 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_BAUDRATE 115200 -#define ESP_WIFI_MODULE_RESET_PIN -1 +#if ENABLED(WIFISUPPORT) + // + // ESP WiFi can be soldered to J9 connector which is wired to USART2. + // + #define ESP_WIFI_MODULE_COM 2 + #define ESP_WIFI_MODULE_BAUDRATE 115200 + #define ESP_WIFI_MODULE_RESET_PIN -1 +#endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h index c29949e814c3..60e33d9dc4ad 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h @@ -390,15 +390,16 @@ #error "SD CUSTOM_CABLE is not compatible with BTT E3 RRF." #endif -// -// WIFI -// - -#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_RESET_PIN PA4 -#define ESP_WIFI_MODULE_ENABLE_PIN PA5 -#define ESP_WIFI_MODULE_GPIO0_PIN PA6 +#if ENABLED(WIFISUPPORT) + // + // WIFI + // + #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_RESET_PIN PA4 + #define ESP_WIFI_MODULE_ENABLE_PIN PA5 + #define ESP_WIFI_MODULE_GPIO0_PIN PA6 +#endif #if ENABLED(BTT_E3_RRF_IDEX_BOARD) #define FPC2_PIN PB11 diff --git a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h index a25c2339f21f..8b061a431c13 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -544,26 +544,28 @@ #define NEOPIXEL_PIN PB0 #endif -// -// WIFI -// +#if ENABLED(WIFISUPPORT) + // + // WIFI + // -/** - * ------- - * GND | 9 | | 8 | 3.3V - * (ESP-CS) PB12 | 10 | | 7 | PB15 (ESP-MOSI) - * 3.3V | 11 | | 6 | PB14 (ESP-MISO) - * (ESP-IO0) PD7 | 12 | | 5 | PB13 (ESP-CLK) - * (ESP-IO4) PD10 | 13 | | 4 | -- - * -- | 14 | | 3 | PE15 (ESP-EN) - * (ESP-RX) PD8 | 15 | | 2 | -- - * (ESP-TX) PD9 | 16 | | 1 | PE14 (ESP-RST) - * ------- - * WIFI - */ -#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_RESET_PIN PG7 -#define ESP_WIFI_MODULE_ENABLE_PIN PG8 -#define ESP_WIFI_MODULE_GPIO0_PIN PD7 -#define ESP_WIFI_MODULE_GPIO4_PIN PD10 + /** + * ------- + * GND | 9 | | 8 | 3.3V + * (ESP-CS) PB12 | 10 | | 7 | PB15 (ESP-MOSI) + * 3.3V | 11 | | 6 | PB14 (ESP-MISO) + * (ESP-IO0) PD7 | 12 | | 5 | PB13 (ESP-CLK) + * (ESP-IO4) PD10 | 13 | | 4 | -- + * -- | 14 | | 3 | PE15 (ESP-EN) + * (ESP-RX) PD8 | 15 | | 2 | -- + * (ESP-TX) PD9 | 16 | | 1 | PE14 (ESP-RST) + * ------- + * WIFI + */ + #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_RESET_PIN PG7 + #define ESP_WIFI_MODULE_ENABLE_PIN PG8 + #define ESP_WIFI_MODULE_GPIO0_PIN PD7 + #define ESP_WIFI_MODULE_GPIO4_PIN PD10 +#endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h index 78a137b35d4d..f848a181131b 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -547,22 +547,24 @@ #endif #endif -// -// WIFI -// +#if ENABLED(WIFISUPPORT) + // + // WIFI + // -/** - * ------ - * RX | 8 7 | 3.3V GPIO0 PF14 ... Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) - * GPIO0 | 6 5 | Reset GPIO2 PF15 ... must be high (ESP3D software configures this with a pullup so OK to leave as floating) - * GPIO2 | 4 3 | Enable Reset PG0 ... active low, probably OK to leave floating - * GND | 2 1 | TX Enable PG1 ... Must be high for module to run - * ------ - * W1 - */ -#define ESP_WIFI_MODULE_COM 6 // 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_RESET_PIN PG0 -#define ESP_WIFI_MODULE_ENABLE_PIN PG1 -#define ESP_WIFI_MODULE_GPIO0_PIN PF14 -#define ESP_WIFI_MODULE_GPIO2_PIN PF15 + /** + * ------ + * RX | 8 7 | 3.3V GPIO0 PF14 ... Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) + * GPIO0 | 6 5 | Reset GPIO2 PF15 ... must be high (ESP3D software configures this with a pullup so OK to leave as floating) + * GPIO2 | 4 3 | Enable Reset PG0 ... active low, probably OK to leave floating + * GND | 2 1 | TX Enable PG1 ... Must be high for module to run + * ------ + * W1 + */ + #define ESP_WIFI_MODULE_COM 6 // 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_RESET_PIN PG0 + #define ESP_WIFI_MODULE_ENABLE_PIN PG1 + #define ESP_WIFI_MODULE_GPIO0_PIN PF14 + #define ESP_WIFI_MODULE_GPIO2_PIN PF15 +#endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h index 7ac9156f405b..10105a6ce830 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h @@ -556,25 +556,27 @@ #define NEOPIXEL_PIN PE6 #endif -// -// WIFI -// +#if ENABLED(WIFISUPPORT) + // + // WIFI + // -/** - * ------- - * GND | 9 | | 8 | 3.3V - * (ESP-CS) PB12 | 10 | | 7 | PB15 (ESP-MOSI) - * 3.3V | 11 | | 6 | PB14 (ESP-MISO) - * (ESP-IO0) PB10 | 12 | | 5 | PB13 (ESP-CLK) - * (ESP-IO4) PB11 | 13 | | 4 | -- - * -- | 14 | | 3 | 3.3V (ESP-EN) - * (ESP-RX) PD8 | 15 | | 2 | -- - * (ESP-TX) PD9 | 16 | | 1 | PC14 (ESP-RST) - * ------- - * WIFI - */ -#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_RESET_PIN PC14 -#define ESP_WIFI_MODULE_GPIO0_PIN PB10 -#define ESP_WIFI_MODULE_GPIO4_PIN PB11 + /** + * ------- + * GND | 9 | | 8 | 3.3V + * (ESP-CS) PB12 | 10 | | 7 | PB15 (ESP-MOSI) + * 3.3V | 11 | | 6 | PB14 (ESP-MISO) + * (ESP-IO0) PB10 | 12 | | 5 | PB13 (ESP-CLK) + * (ESP-IO4) PB11 | 13 | | 4 | -- + * -- | 14 | | 3 | 3.3V (ESP-EN) + * (ESP-RX) PD8 | 15 | | 2 | -- + * (ESP-TX) PD9 | 16 | | 1 | PC14 (ESP-RST) + * ------- + * WIFI + */ + #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_RESET_PIN PC14 + #define ESP_WIFI_MODULE_GPIO0_PIN PB10 + #define ESP_WIFI_MODULE_GPIO4_PIN PB11 +#endif diff --git a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h index 80ea35498200..13e30591ba6a 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h @@ -521,25 +521,27 @@ #define NEOPIXEL2_PIN PE9 #endif -// -// WIFI -// +#if ENABLED(WIFISUPPORT) + // + // WIFI + // -/** - * ------- - * GND | 9 | | 8 | 3.3V - * (ESP-CS) PG1 | 10 | | 7 | PB15 (ESP-MOSI) - * 3.3V | 11 | | 6 | PB14 (ESP-MISO) - * (ESP-IO0) PG0 | 12 | | 5 | PB13 (ESP-CLK) - * (ESP-IO4) PF15 | 13 | | 4 | -- - * -- | 14 | | 3 | 3.3V (ESP-EN) - * (ESP-RX) PE7 | 15 | | 2 | -- - * (ESP-TX) PE8 | 16 | | 1 | PB2 (ESP-RST) - * ------- - * WIFI - */ -#define ESP_WIFI_MODULE_COM 7 // 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_RESET_PIN PB2 -#define ESP_WIFI_MODULE_GPIO0_PIN PG0 -#define ESP_WIFI_MODULE_GPIO4_PIN PF15 + /** + * ------- + * GND | 9 | | 8 | 3.3V + * (ESP-CS) PG1 | 10 | | 7 | PB15 (ESP-MOSI) + * 3.3V | 11 | | 6 | PB14 (ESP-MISO) + * (ESP-IO0) PG0 | 12 | | 5 | PB13 (ESP-CLK) + * (ESP-IO4) PF15 | 13 | | 4 | -- + * -- | 14 | | 3 | 3.3V (ESP-EN) + * (ESP-RX) PE7 | 15 | | 2 | -- + * (ESP-TX) PE8 | 16 | | 1 | PB2 (ESP-RST) + * ------- + * WIFI + */ + #define ESP_WIFI_MODULE_COM 7 // 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_RESET_PIN PB2 + #define ESP_WIFI_MODULE_GPIO0_PIN PG0 + #define ESP_WIFI_MODULE_GPIO4_PIN PF15 +#endif diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h index 809a1f3f8c37..b9e1ff10ad16 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h @@ -543,25 +543,27 @@ #define NEOPIXEL_PIN PE6 #endif -// -// WIFI -// +#if ENABLED(WIFISUPPORT) + // + // WIFI + // -/** - * ------- - * GND | 9 | | 8 | 3.3V - * (ESP-CS) PB12 | 10 | | 7 | PB15 (ESP-MOSI) - * 3.3V | 11 | | 6 | PB14 (ESP-MISO) - * (ESP-IO0) PB10 | 12 | | 5 | PB13 (ESP-CLK) - * (ESP-IO4) PB11 | 13 | | 4 | -- - * -- | 14 | | 3 | 3.3V (ESP-EN) - * (ESP-RX) PD8 | 15 | | 2 | -- - * (ESP-TX) PD9 | 16 | | 1 | PC14 (ESP-RST) - * ------- - * WIFI - */ -#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_RESET_PIN PC14 -#define ESP_WIFI_MODULE_GPIO0_PIN PB10 -#define ESP_WIFI_MODULE_GPIO4_PIN PB11 + /** + * ------- + * GND | 9 | | 8 | 3.3V + * (ESP-CS) PB12 | 10 | | 7 | PB15 (ESP-MOSI) + * 3.3V | 11 | | 6 | PB14 (ESP-MISO) + * (ESP-IO0) PB10 | 12 | | 5 | PB13 (ESP-CLK) + * (ESP-IO4) PB11 | 13 | | 4 | -- + * -- | 14 | | 3 | 3.3V (ESP-EN) + * (ESP-RX) PD8 | 15 | | 2 | -- + * (ESP-TX) PD9 | 16 | | 1 | PC14 (ESP-RST) + * ------- + * WIFI + */ + #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_RESET_PIN PC14 + #define ESP_WIFI_MODULE_GPIO0_PIN PB10 + #define ESP_WIFI_MODULE_GPIO4_PIN PB11 +#endif