FeralAI / GP2040

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

EEPROM needs validation (CRC check) #45

Closed FeralAI closed 2 years ago

FeralAI commented 2 years ago

There is a relatively common issue where if the Pico/RP2040 device has been previously flashed with something other than GP2040, the area of flash used for emulated EEPROM could contain invalid values causing the firmware to misbehave (locked to certain input type, buttons might not work, etc.).

Add CRC check to the EEPROM data and perform an EEPROM reset if the CRC does not match when loaded.

FeralAI commented 2 years ago

CRC check added for AnimationOptions. Need to update MPG library to support storing the checksum.

FeralAI commented 2 years ago

Added in 8f99bfa