From 5f2b00228c60995eafbba3d4ad8849ecd82d505b Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Tue, 28 Feb 2017 23:36:05 +0200 Subject: [PATCH] IDF add some defaults and allow Arduino to run in single-core mode --- Kconfig | 5 +++++ cores/esp32/main.cpp | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Kconfig b/Kconfig index 182adbbb..9419e6fa 100644 --- a/Kconfig +++ b/Kconfig @@ -3,6 +3,11 @@ menu "Arduino Configuration" config ENABLE_ARDUINO_DEPENDS bool select LWIP_SO_RCVBUF + select BT_ENABLED + select ETHERNET + select WIFI_ENABLED + select ESP32_PHY_CALIBRATION_AND_DATA_STORAGE + select MEMMAP_SMP default "y" config AUTOSTART_ARDUINO diff --git a/cores/esp32/main.cpp b/cores/esp32/main.cpp index c2300b41..e2192c3b 100644 --- a/cores/esp32/main.cpp +++ b/cores/esp32/main.cpp @@ -4,6 +4,12 @@ #if CONFIG_AUTOSTART_ARDUINO +#if CONFIG_FREERTOS_UNICORE +#define ARDUINO_RUNNING_CORE 0 +#else +#define ARDUINO_RUNNING_CORE 1 +#endif + void loopTask(void *pvParameters) { setup(); @@ -15,7 +21,7 @@ void loopTask(void *pvParameters) extern "C" void app_main() { initArduino(); - xTaskCreatePinnedToCore(loopTask, "loopTask", 4096, NULL, 1, NULL, 1); + xTaskCreatePinnedToCore(loopTask, "loopTask", 4096, NULL, 1, NULL, ARDUINO_RUNNING_CORE); } #endif