If a soft reset happens while the gamepad module is scanning for button
presses, there is a moment when the pins get de-initialized, but the
gamepad module is still trying to read them, which ends in a crash.
We can avoid it by disabling scanning on reset.
(cherry picked from commit 470a23d4c9)
Conflicts:
atmel-samd/main.c