SAM7-H64: Multiple Button Bug in USB HID Keyboard Example

I have an Olimex SAM7-H64 header board. I made some small modifications to Atmel’s USB HID Keyboard example project to use external pushbutton switches that I connected to two of the PIO lines. It seems to work great until you start operating both switches at the same time. If you push both switches simultaneously for a little while it will eventually get stuck with one switch either in an on or off position. If it gets stuck on, then the key associated with that switch starts to repeat forever. If it gets stuck on, you can stop the repeated keypresses by pressing a key on the keyboard, but after that neither of my pushbuttons work. From this I conclude that it’s not just a USB message getting lost. The board/program must somehow be getting into some kind of an unhandled failure state.

I’m using the arm-elf-gcc toolchain and uploading the program to the board with Sam_I_Am under Linux. I’ve tried everything I can think of to solve this problem including moving all button handling code into the PIT interrupt handler with a software debounce on top of the board’s deglitch filter. But so far I am at a complete loss. Have any of you seen problems like this? Any suggestions for how I might solve the problem? Any help would be greatly appreciated.