Update NRF52 build to work again

This commit is contained in:
geeksville
2020-07-09 19:57:55 -07:00
parent 62c9bad183
commit ed589727d6
13 changed files with 82 additions and 24 deletions

View File

@@ -1,7 +1,13 @@
#include "Thread.h"
#include "timing.h"
#include <assert.h>
namespace concurrency {
#ifdef ARDUINO_ARCH_ESP32
#include "esp_task_wdt.h"
#endif
namespace concurrency
{
void Thread::start(const char *name, size_t stackSize, uint32_t priority)
{
@@ -14,4 +20,27 @@ void Thread::callRun(void *_this)
((Thread *)_this)->doRun();
}
void Thread::serviceWatchdog()
{
#ifdef ARDUINO_ARCH_ESP32
esp_task_wdt_reset();
#endif
}
void Thread::startWatchdog()
{
#ifdef ARDUINO_ARCH_ESP32
auto r = esp_task_wdt_add(taskHandle);
assert(r == ESP_OK);
#endif
}
void Thread::stopWatchdog()
{
#ifdef ARDUINO_ARCH_ESP32
auto r = esp_task_wdt_delete(taskHandle);
assert(r == ESP_OK);
#endif
}
} // namespace concurrency