摘要 |
A method for de-bouncing keyboard and keypad inputs is disclosed including interrupting a processor upon detecting a key press, reading input signals from the key to determine an initial port value and starting a timer. The interrupt is disabled and processing resumes until expiration of the timer. The timer interrupts the processor and the input signals are read a second time and combined with the initial port value to determine a key identifier. The timer is started again and processing resumes. Upon expiration of the timer the processor checks for key release. If release is not detected, the timer is again started. If release occurs, the timer is disabled and the keyboard interrupt is enabled. |