mirror of https://github.com/ARMmbed/mbed-os.git
Fix for calculating CAN timing settings.
NominalPrescaler value needs to be as high as possible to ensure a good approximation of the target CAN speed. Previous usage of macro IS_FDCAN_DATA_TSEG1 refers to (unsupported by Mbed ) FDCAN CAN controller settings and leads to too low prescaler values. Usage Macro IS_FDCAN_NOMINAL_TSEG1 yields optimum results. See also correct macro usage in line #158.pull/15317/head
parent
9ca538338a
commit
581cd80943
|
@ -335,7 +335,7 @@ int can_frequency(can_t *obj, int f)
|
|||
// !When the sample point should be lower than 50%, this must be changed to
|
||||
// !IS_FDCAN_DATA_TSEG2(ntq/nominalPrescaler), since
|
||||
// NTSEG2 and SJW max values are lower. For now the sample point is fix @75%
|
||||
while (!IS_FDCAN_DATA_TSEG1(ntq / nominalPrescaler)) {
|
||||
while (!IS_FDCAN_NOMINAL_TSEG1(ntq / nominalPrescaler)) {
|
||||
nominalPrescaler ++;
|
||||
if (!IS_FDCAN_NOMINAL_PRESCALER(nominalPrescaler)) {
|
||||
error("Could not determine good nominalPrescaler. Bad clock value\n");
|
||||
|
|
Loading…
Reference in New Issue