Issues porting capacitive touch code from Arduino to avr

Note: In the 'avr' version, cli() and sei() are NOT needed in an ISR.