STM32 CAN: Fix issue with speed function calculation

pull/4974/head
bcostm 2017-07-24 16:35:39 +02:00 committed by adbridge
parent 6e045e07af
commit 430a94b700
1 changed files with 4 additions and 4 deletions

View File

@ -180,10 +180,10 @@ static unsigned int can_speed(unsigned int pclk, unsigned int cclk, unsigned cha
} }
if (hit) { if (hit) {
btr = ((timing_pts[bits][1] << 20) & 0x00700000) btr = ((timing_pts[bits][1] << CAN_BTR_TS2_Pos) & CAN_BTR_TS2) |
| ((timing_pts[bits][0] << 16) & 0x000F0000) ((timing_pts[bits][0] << CAN_BTR_TS1_Pos) & CAN_BTR_TS1) |
| ((psjw << 24) & 0x0000C000) ((psjw << CAN_BTR_SJW_Pos) & CAN_BTR_SJW) |
| ((brp << 0) & 0x000003FF); ((brp << CAN_BTR_BRP_Pos) & CAN_BTR_BRP);
} else { } else {
btr = 0xFFFFFFFF; btr = 0xFFFFFFFF;
} }