can-calc-bit-timing: fix MCP251x bit rate calculation

This patch adds the missing -1 to "bt->brp", as correctly used in the kernel
driver.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
Brennan Ashton
2014-01-06 10:35:45 +01:00
committed by Marc Kleine-Budde
parent 61733e322a
commit 31936b5a17
+1 -1
View File
@@ -192,7 +192,7 @@ static void printf_btr_mcp251x(struct can_bittiming *bt, int hdr)
if (hdr) { if (hdr) {
printf("CNF1 CNF2 CNF3"); printf("CNF1 CNF2 CNF3");
} else { } else {
cnf1 = ((bt->sjw - 1) << 6) | bt->brp; cnf1 = ((bt->sjw - 1) << 6) | (bt->brp - 1);
cnf2 = 0x80 | ((bt->phase_seg1 - 1) << 3) | (bt->prop_seg - 1); cnf2 = 0x80 | ((bt->phase_seg1 - 1) << 3) | (bt->prop_seg - 1);
cnf3 = bt->phase_seg2 - 1; cnf3 = bt->phase_seg2 - 1;
printf("0x%02x 0x%02x 0x%02x", cnf1, cnf2, cnf3); printf("0x%02x 0x%02x 0x%02x", cnf1, cnf2, cnf3);