Subversion Repositories HomeAutomation

Rev

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

Rev 667 Rev 671
Line 41... Line 41...
41
    if (!(msg->ExtendedFlag)) return; // We don't care about standard CAN frames.
41
    if (!(msg->ExtendedFlag)) return; // We don't care about standard CAN frames.
42
 
42
 
43
    if (!rxMsgFull) {
43
    if (!rxMsgFull) {
44
        memcpy((void*)&rxMsg, msg, sizeof(rxMsg));
44
        memcpy((void*)&rxMsg, msg, sizeof(rxMsg));
45
        rxMsgFull = 1;
45
        rxMsgFull = 1;
46
    }
-
 
47
}
-
 
48
 
-
 
49
ISR(MCP_INT_VECTOR) {
-
 
50
    // Get first available message from controller and pass it to
-
 
51
    // application handler. If both RX buffers contain messages
-
 
52
    // we will get another interrupt as soon as this one returns.
-
 
53
    if (Can_Receive(&rxMsg) == CAN_OK) {
-
 
54
        // Callbacks are run with global interrupts disabled but
-
 
55
        // with controller flag cleared so another msg can be
-
 
56
        // received while this one is processed.
-
 
57
        Can_Process(&rxMsg);
-
 
58
    }
46
    }
59
}
47
}
60
 
48
 
61
/*-----------------------------------------------------------------------------
49
/*-----------------------------------------------------------------------------
62
 * Main Program
50
 * Main Program