瀏覽代碼

Fixups for ESP32

Scott Lahteine 6 年之前
父節點
當前提交
4555ae448f
共有 3 個文件被更改,包括 23 次插入12 次删除
  1. 7
    2
      Marlin/src/HAL/HAL_ESP32/HAL.h
  2. 3
    1
      Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp
  3. 13
    9
      Marlin/src/pins/pins_ESP32.h

+ 7
- 2
Marlin/src/HAL/HAL_ESP32/HAL.h 查看文件

55
 
55
 
56
 extern portMUX_TYPE spinlock;
56
 extern portMUX_TYPE spinlock;
57
 
57
 
58
-#define NUM_SERIAL 2
59
 #define MYSERIAL0 Serial
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
 #define CRITICAL_SECTION_START portENTER_CRITICAL(&spinlock)
67
 #define CRITICAL_SECTION_START portENTER_CRITICAL(&spinlock)
63
 #define CRITICAL_SECTION_END   portEXIT_CRITICAL(&spinlock)
68
 #define CRITICAL_SECTION_END   portEXIT_CRITICAL(&spinlock)

+ 3
- 1
Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp 查看文件

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

+ 13
- 9
Marlin/src/pins/pins_ESP32.h 查看文件

24
  * Espressif ESP32 (Tensilica Xtensa LX6) pin assignments
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
 #define BOARD_NAME "Espressif ESP32"
31
 #define BOARD_NAME "Espressif ESP32"
28
 
32
 
29
 //
33
 //
39
 #define X_STEP_PIN         128
43
 #define X_STEP_PIN         128
40
 #define X_DIR_PIN          129
44
 #define X_DIR_PIN          129
41
 #define X_ENABLE_PIN       130
45
 #define X_ENABLE_PIN       130
42
-//#define X_CS_PIN            0
46
+//#define X_CS_PIN           0
43
 
47
 
44
 #define Y_STEP_PIN         131
48
 #define Y_STEP_PIN         131
45
 #define Y_DIR_PIN          132
49
 #define Y_DIR_PIN          132
46
 #define Y_ENABLE_PIN       133
50
 #define Y_ENABLE_PIN       133
47
-//#define Y_CS_PIN           13
51
+//#define Y_CS_PIN          13
48
 
52
 
49
 #define Z_STEP_PIN         134
53
 #define Z_STEP_PIN         134
50
 #define Z_DIR_PIN          135
54
 #define Z_DIR_PIN          135
51
 #define Z_ENABLE_PIN       136
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
 #define E0_STEP_PIN        137
58
 #define E0_STEP_PIN        137
55
 #define E0_DIR_PIN         138
59
 #define E0_DIR_PIN         138
56
 #define E0_ENABLE_PIN      139
60
 #define E0_ENABLE_PIN      139
57
-//#define E0_CS_PIN          21
61
+//#define E0_CS_PIN         21
58
 
62
 
59
 //
63
 //
60
 // Temperature Sensors
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
 // Heaters / Fans
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…
取消
儲存