Closed adamgreen closed 9 months ago
Hi! Thanks for this improvement. I finally merged it in https://github.com/pololu/pololu-3pi-2040-robot/commit/6ddb719da080c21d9d1fb03e9f92007a12848f24 (though that's a cherry-pick commit from the Zumo repo so it doesn't show up like a merge).
It seems to work but I would appreciate it if you could take a look too!
Ok. I will pull things together and test it on Friday.
Looks good to me:
Thank you for checking!
I moved the initialization of the OSR, Y, and X registers from the start of the PIO program and put it into the QTRSensors.run() method before starting each sensor read. This reduced the size of the PIO code by 3 instructions.
NOTE: This change requires a more recent build of MicroPython which extends the rp2.StateMachine.exec() method to accept pre-encoded machine code. The commit which adds this functionality can now be found in this MicroPython master branch commit: https://github.com/micropython/micropython/commit/f9958417d8adb21147de776361a4414073cf7c77