From 4c6f695bea0bf5e3262f74be97aea00aa4c9fc03 Mon Sep 17 00:00:00 2001
From: vivian-ng <vivian@maplerain.com>
Date: Mon, 17 Feb 2020 07:44:36 +0900
Subject: [PATCH] Put ESP32 I2S stepper task and Marlin on the same core
 (#16874)

---
 Marlin/src/HAL/HAL_ESP32/i2s.cpp | 2 +-
 Marlin/src/core/boards.h         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Marlin/src/HAL/HAL_ESP32/i2s.cpp b/Marlin/src/HAL/HAL_ESP32/i2s.cpp
index 9f72fcbb0f..d80c3c24e1 100644
--- a/Marlin/src/HAL/HAL_ESP32/i2s.cpp
+++ b/Marlin/src/HAL/HAL_ESP32/i2s.cpp
@@ -308,7 +308,7 @@ int i2s_init() {
   esp_intr_enable(i2s_isr_handle);
 
   // Create the task that will feed the buffer
-  xTaskCreate(stepperTask, "StepperTask", 10000, nullptr, 1, nullptr);
+  xTaskCreatePinnedToCore(stepperTask, "StepperTask", 10000, nullptr, 1, nullptr, CONFIG_ARDUINO_RUNNING_CORE); // run I2S stepper task on same core as rest of Marlin
 
   // Route the i2s pins to the appropriate GPIO
   gpio_matrix_out_check(I2S_DATA, I2S0O_DATA_OUT23_IDX, 0, 0);
diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h
index 4ba9840d81..f4db7b0c57 100644
--- a/Marlin/src/core/boards.h
+++ b/Marlin/src/core/boards.h
@@ -335,8 +335,8 @@
 // Espressif ESP32 WiFi
 //
 #define BOARD_ESPRESSIF_ESP32         6000  // Generic ESP32
-#define BOARD_MRR_ESPA                6001
-#define BOARD_MRR_ESPE                6002
+#define BOARD_MRR_ESPA                6001  // MRR ESPA board based on ESP32 (native pins only)
+#define BOARD_MRR_ESPE                6002  // MRR ESPE board based on ESP32 (with I2S stepper stream)
 #define BOARD_E4D_BOX                 6003  // E4d@BOX
 
 //
-- 
GitLab