Commit dee47949 authored by Damien George's avatar Damien George
Browse files

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).
parent d3bb3e38
......@@ -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
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment