From 039f2b9965ac716f7cb24c3563f6a9bf9e3038da Mon Sep 17 00:00:00 2001 From: Maxwell Beck Date: Sun, 20 Jul 2025 11:13:53 -0500 Subject: feat: Move drive handing to `SIO_IRQ_PROC1` --- src/pico1541.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/pico1541.c') diff --git a/src/pico1541.c b/src/pico1541.c index 8a02587..9864c89 100644 --- a/src/pico1541.c +++ b/src/pico1541.c @@ -1,8 +1,10 @@ +#include #include #include #include #include +#include #include #include @@ -272,15 +274,18 @@ DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff) { return RES_PARERR; } +void drive_irq() { + drive_cycle(&drive); +} + void drive_thread() { drive_init(&drive); drive.image = disk; + + irq_set_exclusive_handler(SIO_IRQ_PROC1, drive_irq); + irq_set_enabled(SIO_IRQ_PROC1, true); multicore_fifo_push_blocking(1); - - while (multicore_fifo_pop_blocking_inline()) { - drive_cycle(&drive); - } } int main() { -- cgit 1.4.1