I don't think you can check comparator levels; that would involve reading analog levels(ADC). What you can do is set the comparator threshold. Then the comparator tells you 'Above' or "Below" threshold by its output. This is what you use to trigger the comparator interrupt.
That's the reason I suggested you turn on the ZCD interrupt on switch press. Now, the very first int after switch press will be captured. You may need to clear the int flag before enabling the CMP interrupt so that you do not process the previous INT which has been flagged.
So, the pseudo code would look like
Code:
SW_Interrupt:
clear CMP interrupt pending flag
enable the CMP interrupt
clear SW interrupt flag(maybe an int on change)
EXIT INT
CMPINT:
Do audio switch(maybe a toggle of the port involved)
EXIT INT
Bookmarks