Page 315 - Embedded Microprocessor Systems Real World Design
P. 315
If PB switches all off,
Set DBCOUN = 0
Set ONFLAG = 0
Set 0F"LAG = 0
Set FCFLAG = 0
Set SEFLAG = 0.
Else (a PB is pressed),
If DBCOUN < 4,
Increment DBCOUN.
If DBCOUN = 4 (debounce done),
Set flag corresponding to pressed switch.
If water low switch active,
If MTCOUN < 258,
Increment MTCOUN
If MTCOUN = 255 (filter timeout), set MTFLAG.
Else (water low switch inactive) clear MTFLAG.
End of 250Hz timer interrupt code.
296 Appendix A