Skip to content

Commit 071d47f

Browse files
author
Daniel Campora
committed
cc3200: Only kick the WDT if it's actually running.
1 parent 6148f8b commit 071d47f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cc3200/mods/pybwdt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ typedef struct {
5757
bool servers_sleeping;
5858
bool simplelink;
5959
bool running;
60-
}pybwdt_data_t;
60+
} pybwdt_data_t;
6161

6262
/******************************************************************************
6363
DECLARE PRIVATE DATA
6464
******************************************************************************/
65-
static pybwdt_data_t pybwdt_data = {.servers = false, .servers_sleeping = false, .simplelink = false, .running = false};
65+
STATIC pybwdt_data_t pybwdt_data = {.servers = false, .servers_sleeping = false, .simplelink = false, .running = false};
6666
STATIC const mp_obj_base_t pyb_wdt_obj = {&pyb_wdt_type};
6767

6868
/******************************************************************************
@@ -130,7 +130,7 @@ STATIC mp_obj_t pyb_wdt_make_new (mp_obj_t type_in, mp_uint_t n_args, mp_uint_t
130130
/// \function wdt_kick()
131131
/// Kicks the watchdog timer
132132
STATIC mp_obj_t pyb_kick_wdt(mp_obj_t self) {
133-
if ((pybwdt_data.servers || pybwdt_data.servers_sleeping) && pybwdt_data.simplelink) {
133+
if ((pybwdt_data.servers || pybwdt_data.servers_sleeping) && pybwdt_data.simplelink && pybwdt_data.running) {
134134
pybwdt_data.servers = false;
135135
pybwdt_data.simplelink = false;
136136
MAP_WatchdogIntClear(WDT_BASE);

0 commit comments

Comments
 (0)