Skip to content

Commit cf819b9

Browse files
committed
*sync with upstream
1 parent ba14950 commit cf819b9

File tree

122 files changed

+1460
-775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+1460
-775
lines changed

Marlin/.github/workflows/check-pr.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
name: PR Bad Target
77

88
on:
9-
pull_request:
9+
pull_request_target:
10+
types: [opened]
1011
branches:
1112
- 1.0.x
1213
- 1.1.x

Marlin/Marlin/Configuration.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,12 +1407,24 @@
14071407
//#define INVERT_K_DIR false
14081408

14091409
// @section extruder
1410-
14111410
// For direct drive extruder v9 set to true, for geared extruder set to false.
14121411
#if ANY(FF_DREAMER_MACHINE, FF_INVENTOR_MACHINE)
1412+
#if ENABLED(FF_EXTRUDER_SWAP)
1413+
#if ENABLED(FF_DREAMER_OLD_MB)
1414+
#define INVERT_E0_DIR true
1415+
#else
14131416
#define INVERT_E0_DIR false
1417+
#endif
14141418
#define INVERT_E1_DIR false
14151419
#else
1420+
#define INVERT_E0_DIR false
1421+
#if ENABLED(FF_DREAMER_OLD_MB)
1422+
#define INVERT_E1_DIR true
1423+
#else
1424+
#define INVERT_E1_DIR false
1425+
#endif
1426+
#endif
1427+
#else
14161428
#define INVERT_E0_DIR true
14171429
#define INVERT_E1_DIR true
14181430
#endif
@@ -1487,7 +1499,7 @@
14871499

14881500
#define Z_MIN_POS 0
14891501
#if ENABLED(FF_INVENTOR_MACHINE)
1490-
#define Z_MAX_POS 155
1502+
#define Z_MAX_POS 160
14911503
#else
14921504
#define Z_MAX_POS 140
14931505
#endif

Marlin/Marlin/Configuration_adv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,6 +2324,7 @@
23242324
*/
23252325
//#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 A0" // Extra G-code to run while executing tool-change command T0
23262326
//#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10" // Extra G-code to run while executing tool-change command T1
2327+
//#define EVENT_GCODE_TOOLCHANGE_ALWAYS_RUN // Always execute above G-code sequences. Use with caution!
23272328

23282329
/**
23292330
* Tool Sensors detect when tools have been picked up or dropped.

Marlin/Marlin/src/HAL/AVR/HAL_SPI.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
#include "../../inc/MarlinConfig.h"
3535

3636
void spiBegin() {
37-
OUT_WRITE(SD_SS_PIN, HIGH);
37+
#if PIN_EXISTS(SD_SS)
38+
OUT_WRITE(SD_SS_PIN, HIGH);
39+
#endif
3840
SET_OUTPUT(SD_SCK_PIN);
3941
SET_INPUT(SD_MISO_PIN);
4042
SET_OUTPUT(SD_MOSI_PIN);

Marlin/Marlin/src/HAL/ESP32/HAL.cpp

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include <esp_adc_cal.h>
2929
#include <HardwareSerial.h>
3030

31+
#if ENABLED(USE_ESP32_TASK_WDT)
32+
#include <esp_task_wdt.h>
33+
#endif
34+
3135
#if ENABLED(WIFISUPPORT)
3236
#include <ESPAsyncWebServer.h>
3337
#include "wifi.h"
@@ -90,8 +94,24 @@ volatile int numPWMUsed = 0,
9094

9195
#endif
9296

93-
void HAL_init_board() {
97+
#if ENABLED(USE_ESP32_EXIO)
98+
HardwareSerial YSerial2(2);
99+
100+
void Write_EXIO(uint8_t IO, uint8_t v) {
101+
if (ISRS_ENABLED()) {
102+
DISABLE_ISRS();
103+
YSerial2.write(0x80 | (((char)v) << 5) | (IO - 100));
104+
ENABLE_ISRS();
105+
}
106+
else
107+
YSerial2.write(0x80 | (((char)v) << 5) | (IO - 100));
108+
}
109+
#endif
94110

111+
void HAL_init_board() {
112+
#if ENABLED(USE_ESP32_TASK_WDT)
113+
esp_task_wdt_init(10, true);
114+
#endif
95115
#if ENABLED(ESP3D_WIFISUPPORT)
96116
esp3dlib.init();
97117
#elif ENABLED(WIFISUPPORT)
@@ -127,7 +147,11 @@ void HAL_init_board() {
127147
// Initialize the i2s peripheral only if the I2S stepper stream is enabled.
128148
// The following initialization is performed after Serial1 and Serial2 are defined as
129149
// their native pins might conflict with the i2s stream even when they are remapped.
130-
TERN_(I2S_STEPPER_STREAM, i2s_init());
150+
#if ENABLED(USE_ESP32_EXIO)
151+
YSerial2.begin(460800 * 3, SERIAL_8N1, 16, 17);
152+
#elif ENABLED(I2S_STEPPER_STREAM)
153+
i2s_init();
154+
#endif
131155
}
132156

133157
void HAL_idletask() {

Marlin/Marlin/src/HAL/ESP32/HAL.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ void HAL_idletask();
142142
inline void HAL_init() {}
143143
void HAL_init_board();
144144

145+
#if ENABLED(USE_ESP32_EXIO)
146+
void Write_EXIO(uint8_t IO, uint8_t v);
147+
#endif
148+
145149
//
146150
// Delay in cycles (used by DELAY_NS / DELAY_US)
147151
//

Marlin/Marlin/src/HAL/ESP32/HAL_SPI.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ static SPISettings spiConfig;
5353
// ------------------------
5454

5555
void spiBegin() {
56-
#if !PIN_EXISTS(SD_SS)
57-
#error "SD_SS_PIN not defined!"
56+
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_SS)
57+
OUT_WRITE(SD_SS_PIN, HIGH);
5858
#endif
59-
60-
OUT_WRITE(SD_SS_PIN, HIGH);
6159
}
6260

6361
void spiInit(uint8_t spiRate) {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
otadata, data, ota, 0xe000, 0x2000,
4+
app0, app, ota_0, 0x10000, 0x180000,
5+
app1, app, ota_1, 0x190000, 0x180000,
6+
spiffs, data, spiffs, 0x310000, 0xF0000,

Marlin/Marlin/src/HAL/ESP32/fastio.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,19 @@
4040
// Set pin as input with pullup mode
4141
#define _PULLUP(IO, v) pinMode(IO, v ? INPUT_PULLUP : INPUT)
4242

43-
// Read a pin wrapper
44-
#define READ(IO) (IS_I2S_EXPANDER_PIN(IO) ? i2s_state(I2S_EXPANDER_PIN_INDEX(IO)) : digitalRead(IO))
45-
46-
// Write to a pin wrapper
47-
#define WRITE(IO, v) (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v))
48-
49-
// Set pin as input wrapper
43+
#if ENABLED(USE_ESP32_EXIO)
44+
// Read a pin wrapper
45+
#define READ(IO) digitalRead(IO)
46+
// Write to a pin wrapper
47+
#define WRITE(IO, v) (IO >= 100 ? Write_EXIO(IO, v) : digitalWrite(IO, v))
48+
#else
49+
// Read a pin wrapper
50+
#define READ(IO) (IS_I2S_EXPANDER_PIN(IO) ? i2s_state(I2S_EXPANDER_PIN_INDEX(IO)) : digitalRead(IO))
51+
// Write to a pin wrapper
52+
#define WRITE(IO, v) (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v))
53+
#endif
54+
55+
// Set pin as input wrapper (0x80 | (v << 5) | (IO - 100))
5056
#define SET_INPUT(IO) _SET_INPUT(IO)
5157

5258
// Set pin as input with pullup wrapper

Marlin/Marlin/src/HAL/ESP32/i2s.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#include "../../inc/MarlinConfigPre.h"
2525

26+
#if DISABLED(USE_ESP32_EXIO)
27+
2628
#include "i2s.h"
2729

2830
#include "../shared/Marduino.h"
@@ -340,4 +342,5 @@ void i2s_push_sample() {
340342
dma.current[dma.rw_pos++] = i2s_port_data;
341343
}
342344

345+
#endif // !USE_ESP32_EXIO
343346
#endif // ARDUINO_ARCH_ESP32

0 commit comments

Comments
 (0)