From dee47949cc8782c2d565de6d6b7e5c1339000061 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 6 Feb 2017 14:38:33 +1100 Subject: [PATCH] extmod/machine_spi: Remove EVENT_POLL_HOOK from soft-SPI transfer func. SPI needs to be fast, and calling the EVENT_POLL_HOOK every byte makes it unusable for ports that need to do non-trivial work in the EVENT_POLL_HOOK call. And individual SPI transfers should be short enough in time that EVENT_POLL_HOOK doesn't need to be called. If something like this proves to be needed in practice then we will need to introduce separate event hook macros, one for "slow" loops (eg select/poll) and one for "fast" loops (eg software I2C, SPI). --- extmod/machine_spi.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/extmod/machine_spi.c b/extmod/machine_spi.c index 6e76784988..a67d294baf 100644 --- a/extmod/machine_spi.c +++ b/extmod/machine_spi.c @@ -90,12 +90,6 @@ void mp_machine_soft_spi_transfer(mp_obj_base_t *self_in, size_t len, const uint if (dest != NULL) { dest[i] = data_in; } - - // Some ports need a regular callback, but probably we don't need - // to do this every byte, or even at all. - #ifdef MICROPY_EVENT_POLL_HOOK - MICROPY_EVENT_POLL_HOOK; - #endif } }