Fix STM32H7 FDCAN FIFO acknowledgment process
Fix FDCAN FIFO acknowledge register definition to make it correct for H7 MCUs. Previous definition contained hardcoded offset instead of using MCU-specific macro. Fix incorrect decoding of buffer element size. During decoding, value returned was erratically set to 7 instead of setting 4th LSB. Buffer element size was then always reported as 15 bytes.
This commit is contained in:
committed by
Karl Palsson
parent
9478931d69
commit
e9c68ff9e8
@@ -79,7 +79,7 @@ unsigned fdcan_get_fifo_element_size(uint32_t canport, unsigned fifo_id)
|
||||
}
|
||||
|
||||
/* Mask is unshifted and at this point, element_size is unshifted too */
|
||||
return 8 + fdcan_dlc_to_length((element_size & FDCAN_RXESC_F0DS_MASK) | 0x7);
|
||||
return 8 + fdcan_dlc_to_length((element_size & FDCAN_RXESC_F0DS_MASK) | 0x8);
|
||||
}
|
||||
|
||||
/** Returns actual size of transmit entry in transmit queue/FIFO for given CAN port.
|
||||
@@ -95,7 +95,7 @@ unsigned fdcan_get_txbuf_element_size(uint32_t canport)
|
||||
{
|
||||
unsigned element_size;
|
||||
element_size = (FDCAN_TXESC(canport) >> FDCAN_TXESC_TBDS_SHIFT) & FDCAN_TXESC_TBDS_MASK;
|
||||
return 8 + fdcan_dlc_to_length((element_size & FDCAN_TXESC_TBDS_MASK) | 0x7);
|
||||
return 8 + fdcan_dlc_to_length((element_size & FDCAN_TXESC_TBDS_MASK) | 0x8);
|
||||
}
|
||||
|
||||
/** Initialize allocation of standard filter block in CAN message RAM.
|
||||
@@ -468,4 +468,4 @@ void fdcan_set_fifo_locked_mode(uint32_t canport, bool locked)
|
||||
}
|
||||
}
|
||||
|
||||
/**@}*/
|
||||
/**@}*/
|
||||
|
||||
Reference in New Issue
Block a user