mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-07 15:12:45 +00:00
move portduino tft task creation into tftSetup
This commit is contained in:
parent
7eb6d0a985
commit
0c615f3dbd
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#ifdef ARCH_PORTDUINO
|
#ifdef ARCH_PORTDUINO
|
||||||
#include "PortduinoGlue.h"
|
#include "PortduinoGlue.h"
|
||||||
|
#include <thread>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DeviceScreen *deviceScreen = nullptr;
|
DeviceScreen *deviceScreen = nullptr;
|
||||||
@ -31,8 +32,6 @@ void tft_task_handler(void *param = nullptr)
|
|||||||
deviceScreen->task_handler();
|
deviceScreen->task_handler();
|
||||||
spiLock->unlock();
|
spiLock->unlock();
|
||||||
deviceScreen->sleep();
|
deviceScreen->sleep();
|
||||||
} else {
|
|
||||||
delay(100);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,11 +117,15 @@ void tftSetup(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (deviceScreen) {
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
tftSleepObserver.observe(¬ifyLightSleep);
|
tftSleepObserver.observe(¬ifyLightSleep);
|
||||||
endSleepObserver.observe(¬ifyLightSleepEnd);
|
endSleepObserver.observe(¬ifyLightSleepEnd);
|
||||||
xTaskCreatePinnedToCore(tft_task_handler, "tft", 10240, NULL, 1, NULL, 0);
|
xTaskCreatePinnedToCore(tft_task_handler, "tft", 10240, NULL, 1, NULL, 0);
|
||||||
|
#elif defined(ARCH_PORTDUINO)
|
||||||
|
std::thread *tft_task = new std::thread([] { tft_task_handler(); });
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue
Block a user