From b5f6d6c4f76a1f715fead9dbe97b1dd2c944a1a7 Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Fri, 27 Oct 2017 06:15:54 -0600 Subject: [PATCH] drivers/can/mcp2515.c: Fix BRP for SET_BITTIMING ioctl as well --- drivers/can/mcp2515.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/can/mcp2515.c b/drivers/can/mcp2515.c index 11c22d50d3..3b68c4d43b 100644 --- a/drivers/can/mcp2515.c +++ b/drivers/can/mcp2515.c @@ -1486,7 +1486,7 @@ static int mcp2515_ioctl(FAR struct can_dev_s *dev, int cmd, unsigned long arg) brp = (uint32_t) (((float) MCP2515_CANCLK_FREQUENCY / - ((float)(tseg1 + tseg2 + 1) * (float)bt->bt_baud)) - 1); + ((float)(tseg1 + tseg2 + 1) * (float)(2 * bt->bt_baud))) - 1); /* Save the value of the new bit timing register */