Skip to content

Commit

Permalink
[EFR32] add watchdog timer
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Dec 2, 2024
1 parent 043aed9 commit 80b3235
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions software/firmware/source/SoftRF/src/platform/EFR32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 34,7 @@
#include "../protocol/data/D1090.h"

#include <ArduinoLowPower.h>
#include <WatchdogTimer.h>

// SX127x pin mapping
lmic_pinmap lmic_pins = {
Expand Down Expand Up @@ -285,6 286,10 @@ static unsigned long rx_led_time_marker = 0;

static void EFR32_loop()
{
if (wdt_is_active) {
WatchdogTimer.feed();
}

#if SOC_GPIO_RADIO_LED_TX != SOC_UNUSED_PIN
if (digitalRead(SOC_GPIO_RADIO_LED_TX) != LED_STATE_ON) {
if (tx_packets_counter != prev_tx_packets_counter) {
Expand Down Expand Up @@ -586,12 591,17 @@ static void EFR32_UATModule_restart()

static void EFR32_WDT_setup()
{
/* TBD */
WatchdogTimer.begin(WDOG_PERIOD_8_S);
wdt_is_active = true;
}

static void EFR32_WDT_fini()
{
/* TBD */
if (wdt_is_active) {
WatchdogTimer.setWatchdogOffWhileSleeping(true);
WatchdogTimer.end();
wdt_is_active = false;
}
}

#if SOC_GPIO_PIN_BUTTON != SOC_UNUSED_PIN
Expand Down

0 comments on commit 80b3235

Please sign in to comment.