Added test-and-clear for ADC, SPI and TMR8 tick.