Merge pull request #15317 from chdelfs/master

Fix for calculating CAN timing settings for STM32
pull/15352/head
Martin Kojtal 2022-11-02 09:49:52 +00:00 committed by GitHub
commit 102d2f86cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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");