FeralAI / GP2040

Gamepad firmware for Raspberry Pi Pico and other RP2040 microcontrollers supporting Nintendo Switch, XInput and DirectInput
https://gp2040.info
MIT License
558 stars 124 forks source link

EEPROM with Multicore Lockout #9

Closed jbarket closed 2 years ago

jbarket commented 2 years ago

EEPROM commit no longer commits, but sets a timer for when the next write should happen. Additional writes in that gap will push the timer out so we don't hammer flash memory. When time hits, we also lock out core1 to prevent any weirdness with data access across cores.

FeralAI commented 2 years ago

I like where this is going, but I'd also like to keep the timer out of the main loop and have it handled automatically. Think we can do something with hardware timers in Pico SDK?

https://raspberrypi.github.io/pico-sdk-doxygen/group__hardware__timer.html