added volatile keywords to variables written to by ISR's, as maple docs recommend