#include /* common defines and macros */ #include /* derivative information */ #include "timer.h" void Debounce_Init(void) { Timer_Init(); } void Debounce_WaitReleasePortTlow4(void) { while((PTT&0x08) == 0 || (PTT&0x04) == 0 || (PTT&0x02) == 0 || (PTT&0x01) == 0); Timer_Wait10ms(1); } void Debounce_WaitPressPortTlow4(void) { while(PTT&0x08 && PTT&0x04 && PTT&0x02 && PTT&0x01); Timer_Wait10ms(1); } void Debounce_WaitReleasePortThigh4(void) { while((PTT&0x80) == 0 || (PTT&0x40) == 0 || (PTT&0x20) == 0 || (PTT&0x10) == 0); Timer_Wait10ms(1); } void Debounce_WaitPressPortThigh4(void) { while(PTT&0x80 && PTT&0x40 && PTT&0x20 && PTT&0x10); Timer_Wait10ms(1); }