From 1d1cd687138a8bb0b3c80dbc1b3cb13bf9ee8ab0 Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Thu, 23 Jan 2020 22:03:26 +0000 Subject: [PATCH] nrf: spi: Feed the watchdog from machine.SPI.write() This is a temporary hack to prevent the WDT triggering during display update loops (e.g. no return to REPL... which is currently when the dog is fed). --- ports/nrf/modules/machine/spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/nrf/modules/machine/spi.c b/ports/nrf/modules/machine/spi.c index 4361a8f8f..1e149711c 100644 --- a/ports/nrf/modules/machine/spi.c +++ b/ports/nrf/modules/machine/spi.c @@ -39,6 +39,7 @@ #include "pin.h" #include "genhdr/pins.h" #include "spi.h" +#include "wdt.h" #if NRFX_SPI_ENABLED #include "nrfx_spi.h" #else @@ -404,6 +405,7 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_readinto_obj, 2, 3, mp_machin STATIC mp_obj_t mp_machine_spi_write(mp_obj_t self, mp_obj_t wr_buf) { mp_buffer_info_t src; mp_get_buffer_raise(wr_buf, &src, MP_BUFFER_READ); + wdt_feed(); spi_transfer(self, src.len, (const uint8_t*)src.buf, NULL); return mp_const_none; }