| 1615 | } |
| 1616 | |
| 1617 | int8_t mcp2518fd::mcp2518fd_ModuleEventTxCodeGet(CAN_TXCODE *txCode) { |
| 1618 | int8_t spiTransferError = 0; |
| 1619 | uint16_t a = 0; |
| 1620 | uint8_t txCodeByte = 0; |
| 1621 | |
| 1622 | // Read |
| 1623 | a = cREGADDR_CiVEC + 2; |
| 1624 | |
| 1625 | spiTransferError = mcp2518fd_ReadByte(a, &txCodeByte); |
| 1626 | if (spiTransferError) { |
| 1627 | return -1; |
| 1628 | } |
| 1629 | |
| 1630 | // Decode data |
| 1631 | // 0x40 = "no interrupt" (CAN_FIFO_CIVEC_NOINTERRUPT) |
| 1632 | if ((txCodeByte < CAN_TXCODE_TOTAL_CHANNELS) || |
| 1633 | (txCodeByte == CAN_TXCODE_NO_INT)) { |
| 1634 | *txCode = (CAN_TXCODE)txCodeByte; |
| 1635 | } else { |
| 1636 | *txCode = CAN_TXCODE_RESERVED; // shouldn't get here |
| 1637 | } |
| 1638 | |
| 1639 | return spiTransferError; |
| 1640 | } |
| 1641 | |
| 1642 | int8_t mcp2518fd::mcp2518fd_TransmitChannelEventAttemptClear(CAN_FIFO_CHANNEL channel) |
| 1643 | { |
nothing calls this directly
no outgoing calls
no test coverage detected