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).
pull/1/head
Daniel Thompson 2020-01-23 22:03:26 +00:00
parent ee1899688b
commit 1d1cd68713
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}