|
//
// *** External interrupt handlers ***
//
// INT0 interrupts come from the mains cross-zero sensor
// The handler calculates the flash period and initiates the flash by TIMER0 interrupts.
//#pragma vector = INT0_vect
__interrupt void INT0_handler(void)
{
PORTB &= ~(1<<6);
if (Counter==0 || ++_TmpCounterreturn;
_TmpCounter = 0; // Reload frequency counter
Flags &= ~NEW_BIT; // Reset the flag
TCNT0 = 256-100; // Set Timer0 (~ 10mS delay)
TIMSK |= (1<TCCR0 = 0x05; // Run Timer0 (CK / 1024 = 128uS)
PORTB |= (1<<6);
}
E-mail: info@telesys.ru