Skip to content

Commit c63f359

Browse files
Cantonplasjdmarmen
andauthored
Fixed fdcan 64 byte sending issue (#515)
* Fixed fdcan 64 byte sending issue * Added an if for modifying the Tx element size depending on the CAN format --------- Co-authored-by: jdmarmen <jdmarmen@upv.edu.es>
1 parent 82b989c commit c63f359

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • Inc/HALAL/Services/Communication/FDCAN

Inc/HALAL/Services/Communication/FDCAN/FDCAN.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,13 @@ uint8_t FDCAN::inscribe(FDCAN::Peripheral& fdcan){
226226
fdcan_instance->hfdcan->Init.TxBuffersNbr = 0;
227227
fdcan_instance->hfdcan->Init.TxFifoQueueElmtsNbr = 16;
228228
fdcan_instance->hfdcan->Init.TxFifoQueueMode = FDCAN_TX_FIFO_OPERATION;
229-
fdcan_instance->hfdcan->Init.TxElmtSize = FDCAN_DATA_BYTES_8;
229+
230+
if constexpr(format == CANFormat::CAN_NORMAL_FORMAT){
231+
fdcan_instance->hfdcan->Init.TxElmtSize = FDCAN_DATA_BYTES_8;
232+
}
233+
else{
234+
fdcan_instance->hfdcan->Init.TxElmtSize = FDCAN_DATA_BYTES_64;
235+
}
230236

231237
Pin::inscribe(fdcan_instance->TX, ALTERNATIVE);
232238
Pin::inscribe(fdcan_instance->RX, ALTERNATIVE);

0 commit comments

Comments
 (0)