Skip to content

Commit

Permalink
Merge pull request #15317 from chdelfs/master
Browse files Browse the repository at this point in the history
Fix for calculating CAN timing settings for STM32
  • Loading branch information
0xc0170 authored Nov 2, 2022
2 parents 4f156de + 9cd4854 commit 102d2f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions targets/TARGET_STM/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 102d2f8

Please sign in to comment.