Merge upstream changes from Marlin 2.1.2
This commit is contained in:
@@ -139,22 +139,40 @@ static void IRAM_ATTR i2s_intr_handler_default(void *arg) {
|
||||
}
|
||||
|
||||
void stepperTask(void *parameter) {
|
||||
uint32_t remaining = 0;
|
||||
uint32_t nextMainISR = 0;
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
uint32_t nextAdvanceISR = Stepper::LA_ADV_NEVER;
|
||||
#endif
|
||||
|
||||
while (1) {
|
||||
for (;;) {
|
||||
xQueueReceive(dma.queue, &dma.current, portMAX_DELAY);
|
||||
dma.rw_pos = 0;
|
||||
|
||||
while (dma.rw_pos < DMA_SAMPLE_COUNT) {
|
||||
// Fill with the port data post pulse_phase until the next step
|
||||
if (remaining) {
|
||||
if (nextMainISR && TERN1(LIN_ADVANCE, nextAdvanceISR))
|
||||
i2s_push_sample();
|
||||
remaining--;
|
||||
}
|
||||
else {
|
||||
|
||||
// i2s_push_sample() is also called from Stepper::pulse_phase_isr() and Stepper::advance_isr()
|
||||
// in a rare case where both are called, we need to double decrement the counters
|
||||
const uint8_t push_count = 1 + (!nextMainISR && TERN0(LIN_ADVANCE, !nextAdvanceISR));
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
if (!nextAdvanceISR) {
|
||||
Stepper::advance_isr();
|
||||
nextAdvanceISR = Stepper::la_interval;
|
||||
}
|
||||
else if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
|
||||
nextAdvanceISR = Stepper::la_interval;
|
||||
#endif
|
||||
|
||||
if (!nextMainISR) {
|
||||
Stepper::pulse_phase_isr();
|
||||
remaining = Stepper::block_phase_isr();
|
||||
nextMainISR = Stepper::block_phase_isr();
|
||||
}
|
||||
|
||||
nextMainISR -= push_count;
|
||||
TERN_(LIN_ADVANCE, nextAdvanceISR -= push_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -45,10 +45,14 @@
|
||||
#error "FAST_PWM_FAN is not available on TinyBee."
|
||||
#endif
|
||||
|
||||
#if BOTH(I2S_STEPPER_STREAM, BABYSTEPPING) && DISABLED(INTEGRATED_BABYSTEPPING)
|
||||
#error "BABYSTEPPING on I2S stream requires INTEGRATED_BABYSTEPPING."
|
||||
#endif
|
||||
|
||||
#if USING_PULLDOWNS
|
||||
#error "PULLDOWN pin mode is not available on ESP32 boards."
|
||||
#endif
|
||||
|
||||
#if BOTH(I2S_STEPPER_STREAM, LIN_ADVANCE)
|
||||
#if BOTH(I2S_STEPPER_STREAM, LIN_ADVANCE) && DISABLED(EXPERIMENTAL_I2S_LA)
|
||||
#error "I2S stream is currently incompatible with LIN_ADVANCE."
|
||||
#endif
|
||||
|
@@ -32,6 +32,13 @@
|
||||
#include "HAL.h"
|
||||
#include "SPI.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#include "../../sd/cardreader.h"
|
||||
#if ENABLED(ESP3D_WIFISUPPORT)
|
||||
#include "sd_ESP32.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static SPISettings spiConfig;
|
||||
|
||||
|
||||
@@ -45,6 +52,11 @@ static SPISettings spiConfig;
|
||||
|
||||
uint8_t u8g_eps_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
|
||||
static uint8_t msgInitCount = 2; // Ignore all messages until 2nd U8G_COM_MSG_INIT
|
||||
|
||||
#if ENABLED(PAUSE_LCD_FOR_BUSY_SD)
|
||||
if (card.flag.saving || card.flag.logging || TERN0(ESP3D_WIFISUPPORT, sd_busy_lock == true)) return 0;
|
||||
#endif
|
||||
|
||||
if (msgInitCount) {
|
||||
if (msg == U8G_COM_MSG_INIT) msgInitCount--;
|
||||
if (msgInitCount) return -1;
|
||||
|
Reference in New Issue
Block a user