|
byte xdata RAW_IO_ADDRESS _at_ 0x7FF0
unsigned char reentrant Debounce_Key(void) {
unsigned char i, key_debounced;
/********************************************************/
/* Software Debounce code in C */
/* Debounce keys (20 to 100 milliseconds) from the IO */
/* If we are using a 25 Mhz 8051, then 20 loops would be*/
/* about 30 milliseconds). Key debounce software. */
/********************************************************/
key_debounced = RAW_IO_ADDRESS;

for (i=0; i<20; i++) {
key_debounced = key_debounced & RAW_IO_ADDRESS;
}
.gif)
return(Key_Debounced);
}
|




Eurobanner: The European Advertising Network