Skip to content

Commit

Permalink
Init all ESP01 (module) WIFI pins (MarlinFirmware#17679)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob-the-Kuhn authored and Emmanuel Viala committed Aug 21, 2020
1 parent 7605dc0 commit d99a44c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
10 changes: 9 additions & 1 deletion Marlin/src/HAL/shared/esp_wifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
#include "../../inc/MarlinConfig.h"
#include "Delay.h"

void esp_wifi_init(void) {
void esp_wifi_init(void) { // init ESP01 WIFI module pins
#if PIN_EXISTS(ESP_WIFI_MODULE_GPIO0)
OUT_WRITE(ESP_WIFI_MODULE_GPIO0_PIN, HIGH);
#endif
#if PIN_EXISTS(ESP_WIFI_MODULE_GPIO2)
OUT_WRITE(ESP_WIFI_MODULE_GPIO2_PIN, HIGH);
#endif
#if PIN_EXISTS(ESP_WIFI_MODULE_RESET)
delay(1); // power up delay (0.1mS minimum)
OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, LOW);
delay(1);
OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, HIGH);
#endif
#if PIN_EXISTS(ESP_WIFI_MODULE_ENABLE)
delay(1); // delay after reset released (0.1mS minimum)
OUT_WRITE(ESP_WIFI_MODULE_ENABLE_PIN, HIGH);
#endif
}
6 changes: 6 additions & 0 deletions Marlin/src/pins/pinsDebug_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -1415,3 +1415,9 @@
#if PIN_EXISTS(ESP_WIFI_MODULE_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, ESP_WIFI_MODULE_ENABLE_PIN)
#endif
#if PIN_EXISTS(ESP_WIFI_MODULE_GPIO0)
REPORT_NAME_DIGITAL(__LINE__, ESP_WIFI_MODULE_GPIO0_PIN)
#endif
#if PIN_EXISTS(ESP_WIFI_MODULE_GPIO2)
REPORT_NAME_DIGITAL(__LINE__, ESP_WIFI_MODULE_GPIO2_PIN)
#endif
14 changes: 8 additions & 6 deletions Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,15 @@
/**
* _____
* TX | 1 2 | GND Enable PG1 // Must be high for module to run
* Enable | 3 4 | GPIO2 Reset PG0 // Leave as unused (OK to leave floating)
* Reset | 5 6 | GPIO0 GPIO2 PF15 // Leave as unused (best to leave floating)
* 3.3V| 7 8 | RX GPIO0 PF14 // Leave as unused (best to leave floating)
* Enable | 3 4 | GPIO2 Reset PG0 // active low, probably OK to leave floating
* Reset | 5 6 | GPIO0 GPIO2 PF15 // must be high (ESP3D software configures this with a pullup so OK to leave as floating)
* 3.3V| 7 8 | RX GPIO0 PF14 // Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating)
*  ̄ ̄
* W1
*/
#define ESP_WIFI_MODULE_COM 6 // Must also set 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 -1
#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

0 comments on commit d99a44c

Please sign in to comment.