mirror of
https://github.com/Seeed-Studio/Seeed_Arduino_CAN.git
synced 2026-07-27 19:55:59 +00:00
Modified mcp2518fd setmode and set fd format
This commit is contained in:
+6
-3
@@ -2423,7 +2423,6 @@ void mcp2518fd::mcp2518fd_TransmitMessageQueue(void)
|
||||
|
||||
// Load message and transmit
|
||||
uint8_t n = DRV_CANFDSPI_DlcToDataBytes((CAN_DLC)txObj.bF.ctrl.DLC);
|
||||
|
||||
mcp2518fd_TransmitChannelLoad(APP_TX_FIFO, &txObj, txd, n, true);
|
||||
}
|
||||
|
||||
@@ -2460,6 +2459,10 @@ byte mcp2518fd::mcp2518fd_sendMsg(const byte *buf, byte len, unsigned long id, b
|
||||
txObj.bF.ctrl.IDE = 0;
|
||||
txObj.bF.ctrl.FDF = 0;
|
||||
}
|
||||
if (len > 8)
|
||||
{
|
||||
txObj.bF.ctrl.FDF = 1;
|
||||
}
|
||||
txObj.bF.ctrl.BRS = true;
|
||||
|
||||
//Prepare data
|
||||
@@ -2554,10 +2557,10 @@ uint8_t mcp2518fd::mcp2518fd_init(byte speedset,const byte clock)
|
||||
|
||||
// Select Normal Mode
|
||||
// mcp2518fd_OperationModeSelect(CAN_CLASSIC_MODE);
|
||||
setMode(CAN_CLASSIC_MODE);
|
||||
setMode(mcpMode);
|
||||
|
||||
// CAN_OPERATION_MODE abc;
|
||||
// abc = DRV_CANFDSPI_OperationModeGet(0);
|
||||
// abc = mcp2518fd_OperationModeGet();
|
||||
// Serial.printf("DRV_CANFDSPI_OperationModeGet = %d\n\r",abc);
|
||||
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ private:
|
||||
unsigned long can_id; // can id
|
||||
byte rtr; // rtr
|
||||
byte nReservedTx; // Count of tx buffers for reserved send
|
||||
CAN_OPERATION_MODE mcpMode; // Current controller mode
|
||||
CAN_OPERATION_MODE mcpMode = CAN_CLASSIC_MODE; // Current controller mode
|
||||
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user