Rev 665 | Rev 693 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 665 | Rev 671 | ||
|---|---|---|---|
| Line 154... | Line 154... | ||
| 154 | if (!(msg->ExtendedFlag)) return; // We don't care about standard CAN frames. |
154 | if (!(msg->ExtendedFlag)) return; // We don't care about standard CAN frames. |
| 155 | 155 | ||
| 156 | if (!rxMsgFull) { |
156 | if (!rxMsgFull) { |
| 157 | memcpy((void*)&rxMsg, msg, sizeof(rxMsg)); |
157 | memcpy((void*)&rxMsg, msg, sizeof(rxMsg)); |
| 158 | rxMsgFull = 1; |
158 | rxMsgFull = 1; |
| 159 | } |
- | |
| 160 | } |
- | |
| 161 | - | ||
| 162 | ISR(MCP_INT_VECTOR) { |
- | |
| 163 | // Get first available message from controller and pass it to |
- | |
| 164 | // application handler. If both RX buffers contain messages |
- | |
| 165 | // we will get another interrupt as soon as this one returns. |
- | |
| 166 | if (Can_Receive(&rxMsg) == CAN_OK) { |
- | |
| 167 | // Callbacks are run with global interrupts disabled but |
- | |
| 168 | // with controller flag cleared so another msg can be |
- | |
| 169 | // received while this one is processed. |
- | |
| 170 | Can_Process(&rxMsg); |
- | |
| 171 | } |
159 | } |
| 172 | } |
160 | } |
| 173 | 161 | ||
| 174 | 162 | ||
| 175 | /*----------------------------------------------------------------------------- |
163 | /*----------------------------------------------------------------------------- |