mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 02:32:23 +00:00
Add 100 msecond delay in tft_task_handler when deviceScreen is null (#6695)
* Add 100 msecond delay in tft_task_handler when deviceScreen is null, to fix 100% usage bug * move portduino tft task creation into tftSetup * remove superfluous check * update platform-native commit --------- Co-authored-by: mverch67 <manuel.verch@gmx.de>
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
[portduino_base]
|
[portduino_base]
|
||||||
platform =
|
platform =
|
||||||
# renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop
|
# renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop
|
||||||
https://github.com/meshtastic/platform-native/archive/e19f77e034590669feaaf26214667b76d0821d06.zip
|
https://github.com/meshtastic/platform-native/archive/622341c6de8a239704318b10c3dbb00c21a3eab3.zip
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -26,12 +27,10 @@ CallbackObserver<DeviceScreen, esp_sleep_wakeup_cause_t> endSleepObserver =
|
|||||||
void tft_task_handler(void *param = nullptr)
|
void tft_task_handler(void *param = nullptr)
|
||||||
{
|
{
|
||||||
while (true) {
|
while (true) {
|
||||||
if (deviceScreen) {
|
spiLock->lock();
|
||||||
spiLock->lock();
|
deviceScreen->task_handler();
|
||||||
deviceScreen->task_handler();
|
spiLock->unlock();
|
||||||
spiLock->unlock();
|
deviceScreen->sleep();
|
||||||
deviceScreen->sleep();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,11 +115,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
|
||||||
Reference in New Issue
Block a user