- ESP32 compile fixes

- ESP32: let FreeRTOS scheduler decide on which core to run each thread
This commit is contained in:
folkert van heusden 2023-03-27 19:32:22 +02:00
parent 6ad2c2c3ad
commit 85d7c57453
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1
5 changed files with 7 additions and 9 deletions

View file

@ -517,14 +517,10 @@ void setup()
Serial.println(F("Connect TTY to bus"));
b->add_tty(tty_);
Serial.print(F("Starting panel (on CPU 0, main emulator runs on CPU "));
Serial.print(xPortGetCoreID());
Serial.println(F(")"));
xTaskCreatePinnedToCore(&console_thread_wrapper_panel, "panel", 2048, cnsl, 1, nullptr, 0);
Serial.println(F("Starting panel"));
xTaskCreate(&console_thread_wrapper_panel, "panel", 2048, cnsl, 1, nullptr);
xTaskCreatePinnedToCore(&console_thread_wrapper_io, "c-io", 2048, cnsl, 1, nullptr, 0);
// setup_wifi_stations();
xTaskCreate(&console_thread_wrapper_io, "c-io", 2048, cnsl, 1, nullptr);
Serial.print(F("Free RAM after init: "));
Serial.println(ESP.getFreeHeap());

1
ESP32/win32.cpp Symbolic link
View file

@ -0,0 +1 @@
../win32.cpp

1
ESP32/win32.h Symbolic link
View file

@ -0,0 +1 @@
../win32.h

View file

@ -21,7 +21,7 @@
{
int e = errno;
#if !defined(_WIN32)
#if !defined(_WIN32) && !defined(ESP32)
(void)endwin();
#endif

View file

@ -25,7 +25,7 @@ void thread_wrapper_kw11(void *p)
kw11_l::kw11_l(bus *const b, console *const cnsl) : b(b), cnsl(cnsl)
{
#if defined(ESP32)
xTaskCreatePinnedToCore(&thread_wrapper_kw11, "kw11-l", 2048, this, 1, nullptr, 0);
xTaskCreate(&thread_wrapper_kw11, "kw11-l", 2048, this, 1, nullptr);
#else
th = new std::thread(std::ref(*this));
#endif