Subversion Repositories HomeAutomation

Rev

Rev 1136 | Rev 1255 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1136 Rev 1137
Line 77... Line 77...
77
void act_dimmer230_pcint_callback(uint8_t id, uint8_t status) //ISR (act_dimmer230_ZC_PCINT_vect) 
77
void act_dimmer230_pcint_callback(uint8_t id, uint8_t status) //ISR (act_dimmer230_ZC_PCINT_vect) 
78
{
78
{
79
    /* only execute if zerocross pin is low (after real zerocross).
79
    /* only execute if zerocross pin is low (after real zerocross).
80
    Calculate the diff from real zero-cross.
80
    Calculate the diff from real zero-cross.
81
    */
81
    */
82
    if (!gpio_get_state(act_dimmer230_ZC_IO))
82
    if (!status)
83
    {
83
    {
84
        xcTimeDiff = TCNT1;
84
        xcTimeDiff = TCNT1;
85
        xcTimeDiff = xcTimeDiff >> 1; //divide by two
85
        xcTimeDiff = xcTimeDiff >> 1; //divide by two
86
        if (xcTimeDiff > 600) {
86
        if (xcTimeDiff > 600) {
87
            xcTimeDiff = 600;
87
            xcTimeDiff = 600;