]> rtime.felk.cvut.cz Git - can-utils.git/blobdiff - can-calc-bit-timing.c
Makefile: add large file support (LFS)
[can-utils.git] / can-calc-bit-timing.c
index a9fb992bf8129f2f568b20c29035a035eceea638..ba50cdc8ce8c09e6acaf26139f6261df41640d69 100644 (file)
@@ -26,7 +26,7 @@
 #define ENOTSUPP       524     /* Operation is not supported */
 #endif
 
-/* usefull defines */
+/* useful defines */
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
 
 #define do_div(a,b) a = (a) / (b)
@@ -192,7 +192,7 @@ static void printf_btr_mcp251x(struct can_bittiming *bt, int hdr)
        if (hdr) {
                printf("CNF1 CNF2 CNF3");
        } 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);
                cnf3 = bt->phase_seg2 - 1;
                printf("0x%02x 0x%02x 0x%02x", cnf1, cnf2, cnf3);