Browse Source

Fixups for ESP32

Scott Lahteine 5 years ago
parent
commit
4555ae448f

+ 7
- 2
Marlin/src/HAL/HAL_ESP32/HAL.h View File

@@ -55,9 +55,14 @@
55 55
 
56 56
 extern portMUX_TYPE spinlock;
57 57
 
58
-#define NUM_SERIAL 2
59 58
 #define MYSERIAL0 Serial
60
-#define MYSERIAL1 webSocketSerial
59
+
60
+#if ENABLED(WIFISUPPORT)
61
+  #define NUM_SERIAL 2
62
+  #define MYSERIAL1 webSocketSerial
63
+#else
64
+  #define NUM_SERIAL 1
65
+#endif
61 66
 
62 67
 #define CRITICAL_SECTION_START portENTER_CRITICAL(&spinlock)
63 68
 #define CRITICAL_SECTION_END   portEXIT_CRITICAL(&spinlock)

+ 3
- 1
Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp View File

@@ -26,8 +26,10 @@
26 26
 #if ENABLED(WIFISUPPORT)
27 27
 
28 28
 #include "WebSocketSerial.h"
29
-#include "wifi.h"
30 29
 
30
+extern WebSocketSerial webSocketSerial;
31
+
32
+#include "wifi.h"
31 33
 #include <AsyncTCP.h>
32 34
 #include <ESPAsyncWebServer.h>
33 35
 

+ 13
- 9
Marlin/src/pins/pins_ESP32.h View File

@@ -24,6 +24,10 @@
24 24
  * Espressif ESP32 (Tensilica Xtensa LX6) pin assignments
25 25
  */
26 26
 
27
+#ifndef ARDUINO_ARCH_ESP32
28
+  "Oops! Select an ESP32 board in 'Tools > Board.'"
29
+#endif
30
+
27 31
 #define BOARD_NAME "Espressif ESP32"
28 32
 
29 33
 //
@@ -39,32 +43,32 @@
39 43
 #define X_STEP_PIN         128
40 44
 #define X_DIR_PIN          129
41 45
 #define X_ENABLE_PIN       130
42
-//#define X_CS_PIN            0
46
+//#define X_CS_PIN           0
43 47
 
44 48
 #define Y_STEP_PIN         131
45 49
 #define Y_DIR_PIN          132
46 50
 #define Y_ENABLE_PIN       133
47
-//#define Y_CS_PIN           13
51
+//#define Y_CS_PIN          13
48 52
 
49 53
 #define Z_STEP_PIN         134
50 54
 #define Z_DIR_PIN          135
51 55
 #define Z_ENABLE_PIN       136
52
-//#define Z_CS_PIN            5 // SS_PIN
56
+//#define Z_CS_PIN           5 // SS_PIN
53 57
 
54 58
 #define E0_STEP_PIN        137
55 59
 #define E0_DIR_PIN         138
56 60
 #define E0_ENABLE_PIN      139
57
-//#define E0_CS_PIN          21
61
+//#define E0_CS_PIN         21
58 62
 
59 63
 //
60 64
 // Temperature Sensors
61 65
 //
62
-#define TEMP_0_PIN         36   // Analog Input
63
-#define TEMP_BED_PIN       39   // Analog Input
66
+#define TEMP_0_PIN          36   // Analog Input
67
+#define TEMP_BED_PIN        39   // Analog Input
64 68
 
65 69
 //
66 70
 // Heaters / Fans
67 71
 //
68
-#define HEATER_0_PIN        2
69
-#define FAN_PIN            13
70
-#define HEATER_BED_PIN      4
72
+#define HEATER_0_PIN         2
73
+#define FAN_PIN             13
74
+#define HEATER_BED_PIN       4

Loading…
Cancel
Save