mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #15317 from chdelfs/master
Fix for calculating CAN timing settings for STM32pull/15352/head
commit
102d2f86cc
|
@ -333,9 +333,9 @@ int can_frequency(can_t *obj, int f)
|
|||
|
||||
uint32_t nominalPrescaler = 1;
|
||||
// !When the sample point should be lower than 50%, this must be changed to
|
||||
// !IS_FDCAN_DATA_TSEG2(ntq/nominalPrescaler), since
|
||||
// !IS_FDCAN_NOMINAL_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