8000 extmod/machine_spi: Remove EVENT_POLL_HOOK from soft-SPI transfer func. · nickzoic/micropython-esp32@dee4794 · GitHub
[go: up one dir, main page]

Skip to content

Commit dee4794

Browse files
committed
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).
1 parent d3bb3e3 commit dee4794

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

extmod/machine_spi.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,6 @@ void mp_machine_soft_spi_transfer(mp_obj_base_t *self_in, size_t len, const uint
9090
if (dest != NULL) {
9191
dest[i] = data_in;
9292
}
93-
94-
// Some ports need a regular callback, but probably we don't need
95-
// to do this every byte, or even at all.
96-
#ifdef MICROPY_EVENT_POLL_HOOK
97-
MICROPY_EVENT_POLL_HOOK;
98-
#endif
9993
}
10094
}
10195

0 commit comments

Comments
 (0)
0