firmware/src/concurrency/WorkerThread.cpp

33 lines
701 B
C++
Raw Normal View History

#include "WorkerThread.h"
2020-07-06 08:45:55 +00:00
#include "timing.h"
namespace concurrency {
void WorkerThread::doRun()
{
2020-07-06 19:53:10 +00:00
startWatchdog();
while (!wantExit) {
2020-07-06 19:53:10 +00:00
stopWatchdog();
block();
2020-07-06 19:53:10 +00:00
startWatchdog();
// no need - startWatchdog is guaranteed to give us one full watchdog interval
// serviceWatchdog(); // Let our loop worker have one full watchdog interval (at least) to run
#ifdef DEBUG_STACK
static uint32_t lastPrint = 0;
2020-07-06 08:45:55 +00:00
if (timing::millis() - lastPrint > 10 * 1000L) {
lastPrint = timing::millis();
2020-07-06 19:53:10 +00:00
meshtastic::printThreadInfo("net");
}
#endif
loop();
}
2020-07-06 19:53:10 +00:00
stopWatchdog();
}
} // namespace concurrency