Rev 669 | Rev 680 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 669 | Rev 670 | ||
|---|---|---|---|
| Line 93... | Line 93... | ||
| 93 | if (!rxMsgFull) { |
93 | if (!rxMsgFull) { |
| 94 | memcpy((void*)&rxMsg, msg, sizeof(rxMsg)); |
94 | memcpy((void*)&rxMsg, msg, sizeof(rxMsg)); |
| 95 | rxMsgFull = 1; |
95 | rxMsgFull = 1; |
| 96 | } |
96 | } |
| 97 | } |
97 | } |
| 98 | - | ||
| 99 | ISR(MCP_INT_VECTOR) { |
- | |
| 100 | // Get first available message from controller and pass it to |
- | |
| 101 | // application handler. If both RX buffers contain messages |
- | |
| 102 | // we will get another interrupt as soon as this one returns. |
- | |
| 103 | if (Can_Receive(&rxMsg) == CAN_OK) { |
- | |
| 104 | // Callbacks are run with global interrupts disabled but |
- | |
| 105 | // with controller flag cleared so another msg can be |
- | |
| 106 | // received while this one is processed. |
- | |
| 107 | Can_Process(&rxMsg); |
- | |
| 108 | } |
- | |
| 109 | } |
- | |
| 110 | - | ||
| 111 | 98 | ||
| 112 | /*----------------------------------------------------------------------------- |
99 | /*----------------------------------------------------------------------------- |
| 113 | * Main Program |
100 | * Main Program |
| 114 | *---------------------------------------------------------------------------*/ |
101 | *---------------------------------------------------------------------------*/ |
| 115 | int main(void) { |
102 | int main(void) { |