can-calc-bit-timing: beautify btr register printing

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
pull/333/head
Marc Kleine-Budde 2022-01-15 23:31:25 +01:00
parent 2636640aa7
commit e7b5920b10
1 changed files with 3 additions and 3 deletions

View File

@ -205,7 +205,7 @@ static void printf_btr_sja1000(struct can_bittiming *bt, bool hdr)
uint8_t btr0, btr1; uint8_t btr0, btr1;
if (hdr) { if (hdr) {
printf("BTR0 BTR1"); printf("%9s", "BTR0 BTR1");
} else { } else {
btr0 = ((bt->brp - 1) & 0x3f) | (((bt->sjw - 1) & 0x3) << 6); btr0 = ((bt->brp - 1) & 0x3f) | (((bt->sjw - 1) & 0x3) << 6);
btr1 = ((bt->prop_seg + bt->phase_seg1 - 1) & 0xf) | btr1 = ((bt->prop_seg + bt->phase_seg1 - 1) & 0xf) |
@ -260,7 +260,7 @@ static void printf_btr_mcp251x(struct can_bittiming *bt, bool hdr)
static void printf_btr_mcp251xfd(struct can_bittiming *bt, bool hdr) static void printf_btr_mcp251xfd(struct can_bittiming *bt, bool hdr)
{ {
if (hdr) { if (hdr) {
printf("NBTCFG"); printf("%10s", "NBTCFG");
} else { } else {
uint32_t nbtcfg = ((bt->brp - 1) << 24) | uint32_t nbtcfg = ((bt->brp - 1) << 24) |
((bt->prop_seg + bt->phase_seg1 - 1) << 16) | ((bt->prop_seg + bt->phase_seg1 - 1) << 16) |
@ -327,7 +327,7 @@ static void printf_btr_bxcan(struct can_bittiming *bt, bool hdr)
static void printf_btr_c_can(struct can_bittiming *bt, bool hdr) static void printf_btr_c_can(struct can_bittiming *bt, bool hdr)
{ {
if (hdr) { if (hdr) {
printf("%s", " BTR BRPEXT"); printf("%13s", "BTR BRPEXT");
} else { } else {
uint32_t btr; uint32_t btr;
uint32_t brpext; uint32_t brpext;