Skip to content

Commit b226623

Browse files
committed
Merge branch 'bugfix-2.0.x' into 2.0.x-Sapphire-Pro
2 parents f7e4299 + 4a73379 commit b226623

Some content is hidden

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

41 files changed

+463
-366
lines changed

Marlin/Configuration.h

+5
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,11 @@
693693
#define X_DRIVER_TYPE TMC2209
694694
#define Y_DRIVER_TYPE TMC2209
695695
#define Z_DRIVER_TYPE TMC2209
696+
//#define X2_DRIVER_TYPE A4988
697+
//#define Y2_DRIVER_TYPE A4988
698+
//#define Z2_DRIVER_TYPE A4988
699+
//#define Z3_DRIVER_TYPE A4988
700+
//#define Z4_DRIVER_TYPE A4988
696701
#define E0_DRIVER_TYPE TMC2209
697702
//#define E1_DRIVER_TYPE A4988
698703
//#define E2_DRIVER_TYPE A4988

Marlin/Configuration_adv.h

+4
Original file line numberDiff line numberDiff line change
@@ -2784,6 +2784,10 @@
27842784
*/
27852785
#define FASTER_GCODE_PARSER
27862786

2787+
#if ENABLED(FASTER_GCODE_PARSER)
2788+
//#define GCODE_QUOTED_STRINGS // Support for quoted string parameters
2789+
#endif
2790+
27872791
/**
27882792
* CNC G-code options
27892793
* Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc.

Marlin/src/HAL/HAL_AVR/HAL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
//#define analogInputToDigitalPin(IO) IO
5454

5555
#ifndef CRITICAL_SECTION_START
56-
#define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli()
57-
#define CRITICAL_SECTION_END SREG = _sreg
56+
#define CRITICAL_SECTION_START() unsigned char _sreg = SREG; cli()
57+
#define CRITICAL_SECTION_END() SREG = _sreg
5858
#endif
5959
#define ISRS_ENABLED() TEST(SREG, SREG_I)
6060
#define ENABLE_ISRS() sei()

Marlin/src/HAL/HAL_DUE/HAL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ typedef int8_t pin_t;
119119
//
120120
// Interrupts
121121
//
122-
#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
123-
#define CRITICAL_SECTION_END if (!primask) __enable_irq()
122+
#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
123+
#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
124124
#define ISRS_ENABLED() (!__get_PRIMASK())
125125
#define ENABLE_ISRS() __enable_irq()
126126
#define DISABLE_ISRS() __disable_irq()

Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ static pfnISR_Handler* get_relocated_table_addr() {
6363
memcpy(&ram_tab, romtab, sizeof(ram_tab));
6464

6565
// Disable global interrupts
66-
CRITICAL_SECTION_START;
66+
CRITICAL_SECTION_START();
6767

6868
// Set the vector table base address to the SRAM copy
6969
SCB->VTOR = (uint32_t)(&ram_tab);
7070

7171
// Reenable interrupts
72-
CRITICAL_SECTION_END;
72+
CRITICAL_SECTION_END();
7373

7474
// Return the address of the table
7575
return (pfnISR_Handler*)(&ram_tab);
@@ -80,7 +80,7 @@ pfnISR_Handler install_isr(IRQn_Type irq, pfnISR_Handler newHandler) {
8080
pfnISR_Handler *isrtab = get_relocated_table_addr();
8181

8282
// Disable global interrupts
83-
CRITICAL_SECTION_START;
83+
CRITICAL_SECTION_START();
8484

8585
// Get the original handler
8686
pfnISR_Handler oldHandler = isrtab[irq + 16];
@@ -89,7 +89,7 @@ pfnISR_Handler install_isr(IRQn_Type irq, pfnISR_Handler newHandler) {
8989
isrtab[irq + 16] = newHandler;
9090

9191
// Reenable interrupts
92-
CRITICAL_SECTION_END;
92+
CRITICAL_SECTION_END();
9393

9494
// Return the original one
9595
return oldHandler;

Marlin/src/HAL/HAL_ESP32/HAL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ extern portMUX_TYPE spinlock;
6565
#define NUM_SERIAL 1
6666
#endif
6767

68-
#define CRITICAL_SECTION_START portENTER_CRITICAL(&spinlock)
69-
#define CRITICAL_SECTION_END portEXIT_CRITICAL(&spinlock)
68+
#define CRITICAL_SECTION_START() portENTER_CRITICAL(&spinlock)
69+
#define CRITICAL_SECTION_END() portEXIT_CRITICAL(&spinlock)
7070
#define ISRS_ENABLED() (spinlock.owner == portMUX_FREE_VAL)
7171
#define ENABLE_ISRS() if (spinlock.owner != portMUX_FREE_VAL) portEXIT_CRITICAL(&spinlock)
7272
#define DISABLE_ISRS() portENTER_CRITICAL(&spinlock)

Marlin/src/HAL/HAL_LINUX/HAL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ extern HalSerial usb_serial;
7272
//
7373
// Interrupts
7474
//
75-
#define CRITICAL_SECTION_START
76-
#define CRITICAL_SECTION_END
75+
#define CRITICAL_SECTION_START()
76+
#define CRITICAL_SECTION_END()
7777
#define ISRS_ENABLED()
7878
#define ENABLE_ISRS()
7979
#define DISABLE_ISRS()

Marlin/src/HAL/HAL_LPC1768/HAL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ extern "C" volatile uint32_t _millis;
119119
//
120120
// Interrupts
121121
//
122-
#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
123-
#define CRITICAL_SECTION_END if (!primask) __enable_irq()
122+
#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
123+
#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
124124
#define ISRS_ENABLED() (!__get_PRIMASK())
125125
#define ENABLE_ISRS() __enable_irq()
126126
#define DISABLE_ISRS() __disable_irq()

Marlin/src/HAL/HAL_SAMD51/HAL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ typedef int8_t pin_t;
101101
//
102102
// Interrupts
103103
//
104-
#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
105-
#define CRITICAL_SECTION_END if (!primask) __enable_irq()
104+
#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
105+
#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
106106
#define ISRS_ENABLED() (!__get_PRIMASK())
107107
#define ENABLE_ISRS() __enable_irq()
108108
#define DISABLE_ISRS() __disable_irq()

Marlin/src/HAL/HAL_SAMD51/fastio.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@
8888
const EPortType port = (EPortType)GET_SAMD_PORT(IO); \
8989
const uint32_t pin = GET_SAMD_PIN(IO); \
9090
\
91-
PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_INEN); \
9291
PORT->Group[port].DIRSET.reg = MASK(pin); \
92+
PORT->Group[port].PINCFG[pin].reg = 0; \
9393
}while(0)
9494
// Set pin as output (open drain)
9595
#define SET_OUTPUT_OD(IO) do{ \

Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#endif
4545

4646
#if ENABLED(EEPROM_SETTINGS) && NONE(SPI_EEPROM, I2C_EEPROM)
47-
#warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Activator"
47+
#warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Manager/releases"
4848
#endif
4949

5050
#if HAS_TMC_SW_SERIAL

Marlin/src/HAL/HAL_STM32/HAL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@
127127
#define analogInputToDigitalPin(p) (p)
128128
#endif
129129

130-
#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
131-
#define CRITICAL_SECTION_END if (!primask) __enable_irq()
130+
#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
131+
#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
132132
#define ISRS_ENABLED() (!__get_PRIMASK())
133133
#define ENABLE_ISRS() __enable_irq()
134134
#define DISABLE_ISRS() __disable_irq()

Marlin/src/HAL/HAL_STM32F1/HAL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ void HAL_idletask();
162162
#define digitalPinHasPWM(P) (PIN_MAP[P].timer_device != nullptr)
163163
#endif
164164

165-
#define CRITICAL_SECTION_START uint32_t primask = __get_primask(); (void)__iCliRetVal()
166-
#define CRITICAL_SECTION_END if (!primask) (void)__iSeiRetVal()
165+
#define CRITICAL_SECTION_START() uint32_t primask = __get_primask(); (void)__iCliRetVal()
166+
#define CRITICAL_SECTION_END() if (!primask) (void)__iSeiRetVal()
167167
#define ISRS_ENABLED() (!__get_primask())
168168
#define ENABLE_ISRS() ((void)__iSeiRetVal())
169169
#define DISABLE_ISRS() ((void)__iCliRetVal())

Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@
127127
#define analogInputToDigitalPin(p) (p)
128128
#endif
129129

130-
#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
131-
#define CRITICAL_SECTION_END if (!primask) __enable_irq()
130+
#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
131+
#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
132132
#define ISRS_ENABLED() (!__get_PRIMASK())
133133
#define ENABLE_ISRS() __enable_irq()
134134
#define DISABLE_ISRS() __disable_irq()

Marlin/src/HAL/HAL_TEENSY31_32/HAL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ typedef int8_t pin_t;
7070
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
7171
#endif
7272

73-
#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
74-
#define CRITICAL_SECTION_END if (!primask) __enable_irq()
73+
#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
74+
#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
7575
#define ISRS_ENABLED() (!__get_PRIMASK())
7676
#define ENABLE_ISRS() __enable_irq()
7777
#define DISABLE_ISRS() __disable_irq()

Marlin/src/HAL/HAL_TEENSY35_36/HAL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ typedef int8_t pin_t;
7373
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
7474
#endif
7575

76-
#define CRITICAL_SECTION_START uint32_t primask = __get_primask(); __disable_irq()
77-
#define CRITICAL_SECTION_END if (!primask) __enable_irq()
76+
#define CRITICAL_SECTION_START() uint32_t primask = __get_primask(); __disable_irq()
77+
#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
7878
#define ISRS_ENABLED() (!__get_primask())
7979
#define ENABLE_ISRS() __enable_irq()
8080
#define DISABLE_ISRS() __disable_irq()

Marlin/src/HAL/shared/servo.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ void Servo::writeMicroseconds(int value) {
129129
value = constrain(value, SERVO_MIN(min), SERVO_MAX(max)) - (TRIM_DURATION);
130130
value = usToTicks(value); // convert to ticks after compensating for interrupt overhead - 12 Aug 2009
131131

132-
CRITICAL_SECTION_START;
132+
CRITICAL_SECTION_START();
133133
servo_info[channel].ticks = value;
134-
CRITICAL_SECTION_END;
134+
CRITICAL_SECTION_END();
135135
}
136136
}
137137

Marlin/src/feature/Max7219_Debug_LEDs.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 };
125125
#define SIG_DELAY() DELAY_US(1) // Approximate a 1µs delay on 32-bit ARM
126126
#undef CRITICAL_SECTION_START
127127
#undef CRITICAL_SECTION_END
128-
#define CRITICAL_SECTION_START NOOP
129-
#define CRITICAL_SECTION_END NOOP
128+
#define CRITICAL_SECTION_START() NOOP
129+
#define CRITICAL_SECTION_END() NOOP
130130
#else
131131
#define SIG_DELAY() DELAY_NS(188) // Delay for 0.1875µs (16MHz AVR) or 0.15µs (20MHz AVR)
132132
#endif
@@ -163,7 +163,7 @@ inline uint32_t flipped(const uint32_t bits, const uint8_t n_bytes) {
163163
}
164164

165165
void Max7219::noop() {
166-
CRITICAL_SECTION_START;
166+
CRITICAL_SECTION_START();
167167
SIG_DELAY();
168168
WRITE(MAX7219_DIN_PIN, LOW);
169169
for (uint8_t i = 16; i--;) {
@@ -174,11 +174,11 @@ void Max7219::noop() {
174174
WRITE(MAX7219_CLK_PIN, HIGH);
175175
SIG_DELAY();
176176
}
177-
CRITICAL_SECTION_END;
177+
CRITICAL_SECTION_END();
178178
}
179179

180180
void Max7219::putbyte(uint8_t data) {
181-
CRITICAL_SECTION_START;
181+
CRITICAL_SECTION_START();
182182
for (uint8_t i = 8; i--;) {
183183
SIG_DELAY();
184184
WRITE(MAX7219_CLK_PIN, LOW); // tick
@@ -189,7 +189,7 @@ void Max7219::putbyte(uint8_t data) {
189189
SIG_DELAY();
190190
data <<= 1;
191191
}
192-
CRITICAL_SECTION_END;
192+
CRITICAL_SECTION_END();
193193
}
194194

195195
void Max7219::pulse_load() {
@@ -202,12 +202,12 @@ void Max7219::pulse_load() {
202202

203203
void Max7219::send(const uint8_t reg, const uint8_t data) {
204204
SIG_DELAY();
205-
CRITICAL_SECTION_START;
205+
CRITICAL_SECTION_START();
206206
SIG_DELAY();
207207
putbyte(reg); // specify register
208208
SIG_DELAY();
209209
putbyte(data); // put data
210-
CRITICAL_SECTION_END;
210+
CRITICAL_SECTION_END();
211211
}
212212

213213
// Send out a single native row of bits to just one unit
@@ -574,14 +574,14 @@ void Max7219::idle_tasks() {
574574
#define MAX7219_USE_HEAD (defined(MAX7219_DEBUG_PLANNER_HEAD) || defined(MAX7219_DEBUG_PLANNER_QUEUE))
575575
#define MAX7219_USE_TAIL (defined(MAX7219_DEBUG_PLANNER_TAIL) || defined(MAX7219_DEBUG_PLANNER_QUEUE))
576576
#if MAX7219_USE_HEAD || MAX7219_USE_TAIL
577-
CRITICAL_SECTION_START;
577+
CRITICAL_SECTION_START();
578578
#if MAX7219_USE_HEAD
579579
const uint8_t head = planner.block_buffer_head;
580580
#endif
581581
#if MAX7219_USE_TAIL
582582
const uint8_t tail = planner.block_buffer_tail;
583583
#endif
584-
CRITICAL_SECTION_END;
584+
CRITICAL_SECTION_END();
585585
#endif
586586

587587
#if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE)

Marlin/src/gcode/host/M115.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,26 @@
3333
#endif
3434

3535
/**
36-
* M115: Capabilities string
36+
* M115: Capabilities string and extended capabilities report
37+
* If a capability is not reported, hosts should assume
38+
* the capability is not present.
3739
*/
3840
void GcodeSuite::M115() {
3941

4042
SERIAL_ECHOLNPGM(MSG_M115_REPORT);
4143

4244
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
4345

46+
// PAREN_COMMENTS
47+
#if ENABLED(PAREN_COMMENTS)
48+
cap_line(PSTR("PAREN_COMMENTS"), true);
49+
#endif
50+
51+
// QUOTED_STRINGS
52+
#if ENABLED(GCODE_QUOTED_STRINGS)
53+
cap_line(PSTR("QUOTED_STRINGS"), true);
54+
#endif
55+
4456
// SERIAL_XON_XOFF
4557
cap_line(PSTR("SERIAL_XON_XOFF")
4658
#if ENABLED(SERIAL_XON_XOFF)
@@ -171,6 +183,5 @@ void GcodeSuite::M115() {
171183
#endif
172184
);
173185

174-
175186
#endif // EXTENDED_CAPABILITIES_REPORT
176187
}

0 commit comments

Comments
 (0)