@@ -156,7 +156,6 @@ int8_t mcp2518fd::mcp2518fd_ReadByte(uint16_t address, uint8_t *rxd)
156156 SPI_END ();
157157#endif
158158 delay (10 );
159- Serial.printf (" DRV_CANFDSPI_ReadByte = %d\n\r " , spiReceiveBuffer[2 ]);
160159 // Update data
161160 *rxd = spiReceiveBuffer[2 ];
162161
@@ -1945,7 +1944,6 @@ int8_t mcp2518fd::mcp2518fd_TransmitChannelLoad(
19451944 CAN_FIFO_CHANNEL channel, CAN_TX_MSGOBJ *txObj,
19461945 uint8_t *txd, uint32_t txdNumBytes, bool flush)
19471946{
1948- Serial.printf (" into DRV_CANFDSPI_TransmitChannelLoad\n\r " );
19491947 uint16_t a;
19501948 uint32_t fifoReg[3 ];
19511949 uint32_t dataBytesInObject;
@@ -2021,16 +2019,6 @@ int8_t mcp2518fd::mcp2518fd_TransmitChannelLoad(
20212019 txBuffer[i + 8 + j] = 0 ;
20222020 }
20232021 }
2024-
2025- Serial.printf (" txBuffer[8] = %d\n\r " , txBuffer[8 ]);
2026- Serial.printf (" txBuffer[9] = %d\n\r " , txBuffer[9 ]);
2027- Serial.printf (" txBuffer[10] = %d\n\r " , txBuffer[10 ]);
2028- Serial.printf (" txBuffer[11] = %d\n\r " , txBuffer[11 ]);
2029- Serial.printf (" txBuffer[12] = %d\n\r " , txBuffer[12 ]);
2030- Serial.printf (" txBuffer[13] = %d\n\r " , txBuffer[13 ]);
2031- Serial.printf (" txBuffer[14] = %d\n\r " , txBuffer[14 ]);
2032- Serial.printf (" txBuffer[15] = %d\n\r " , txBuffer[15 ]);
2033-
20342022 spiTransferError = mcp2518fd_WriteByteArray (a, txBuffer, txdNumBytes + 8 + n);
20352023 if (spiTransferError)
20362024 {
@@ -2043,14 +2031,11 @@ int8_t mcp2518fd::mcp2518fd_TransmitChannelLoad(
20432031 {
20442032 return -5 ;
20452033 }
2046-
2047- Serial.printf (" end DRV_CANFDSPI_TransmitChannelLoad\n\r " );
20482034 return spiTransferError;
20492035}
20502036
20512037int8_t mcp2518fd::mcp2518fd_ReceiveChannelEventGet (CAN_FIFO_CHANNEL channel, CAN_RX_FIFO_EVENT *flags)
20522038{
2053- Serial.println (" DRV_CANFDSPI_ReceiveChannelEventGet\n\r " );
20542039 int8_t spiTransferError = 0 ;
20552040 uint16_t a = 0 ;
20562041
@@ -2070,9 +2055,6 @@ int8_t mcp2518fd::mcp2518fd_ReceiveChannelEventGet(CAN_FIFO_CHANNEL channel, CAN
20702055
20712056 // Update data
20722057 *flags = (CAN_RX_FIFO_EVENT)(ciFifoSta.byte [0 ] & CAN_RX_FIFO_ALL_EVENTS);
2073-
2074- Serial.printf (" DRV_CANFDSPI_ReceiveChannelEventGet flags = %x\n\r " , (*flags));
2075-
20762058 return spiTransferError;
20772059}
20782060
@@ -2098,10 +2080,8 @@ int8_t mcp2518fd::mcp2518fd_ReceiveMessageGet(
20982080 return -1 ;
20992081 }
21002082
2101- Serial.printf (" ciFifoCon.txBF.TxEnable2 = %d\n\r " , ciFifoCon.txBF .TxEnable );
21022083 // Check that it is a receive buffer
21032084 ciFifoCon.word = fifoReg[0 ];
2104- Serial.printf (" ciFifoCon.txBF.TxEnable3 = %d\n\r " , fifoReg[0 ]);
21052085 ciFifoCon.txBF .TxEnable = 0 ;
21062086 if (ciFifoCon.txBF .TxEnable )
21072087 {
@@ -2194,7 +2174,6 @@ int8_t mcp2518fd::mcp2518fd_ReceiveMessageGet(
21942174 return -4 ;
21952175 }
21962176
2197- Serial.printf (" DRV_CANFDSPI_ReceiveMessageGet end\n\r " );
21982177 return spiTransferError;
21992178}
22002179
@@ -2805,15 +2784,9 @@ byte mcp2518fd::checkError(void) {
28052784// *********************************************************************************************************/
28062785byte mcp2518fd::mcp2518fd_readMsgBufID (volatile byte *len, volatile byte *buf)
28072786{
2808-
2809-
28102787 mcp2518fd_ReceiveMessageGet (APP_RX_FIFO, &rxObj, rxd, MAX_DATA_BYTES);
2811-
2812-
28132788 can_id = (unsigned long )rxObj.bF .id .SID ;
2814- Serial.printf (" readMsgBufID can_id= %lu\n\r " ,can_id);
28152789 uint8_t n = DRV_CANFDSPI_DlcToDataBytes ((CAN_DLC)rxObj.bF .ctrl .DLC );
2816- Serial.printf (" readMsgBufID n= %d\n\r " ,n);
28172790 *len = n;
28182791
28192792 for (int i = 0 ; i < n; i++)
@@ -2911,26 +2884,6 @@ byte mcp2518fd::sendMsgBuf(unsigned long id, byte ext, byte len, const byte *buf
29112884*********************************************************************************************************/
29122885byte mcp2518fd::readRxTxStatus (void )
29132886{
2914- // byte ret = (mcp2515_readStatus() & (MCP_STAT_TXIF_MASK | MCP_STAT_RXIF_MASK));
2915- // ret = (ret & MCP_STAT_TX0IF ? MCP_TX0IF : 0) |
2916- // (ret & MCP_STAT_TX1IF ? MCP_TX1IF : 0) |
2917- // (ret & MCP_STAT_TX2IF ? MCP_TX2IF : 0) |
2918- // (ret & MCP_STAT_RXIF_MASK); // Rx bits happend to be same on status and MCP_CANINTF
2919- // return ret;
2920- // byte ret;
2921- // CAN_RXCODE rxCode;
2922- // CAN_TXCODE txCode;
2923- // mcp2518fd_ModuleEventRxCodeGet(rxCode);
2924- // mcp2518fd_ModuleEventTxCodeGet(txCode);
2925- // if (rxCode != CAN_RXCODE_RESERVED)
2926- // {
2927- // ret = (byte)rxCode;
2928- // }
2929- // if (txCode != CAN_RXCODE_RESERVED)
2930- // {
2931- // ret = (byte)txCode;
2932- // }
2933-
29342887 byte ret;
29352888 mcp2518fd_ReceiveChannelEventGet (APP_RX_FIFO, &rxFlags);
29362889 ret = (byte)rxFlags;
0 commit comments