drivers/can/mcp2515.c: Fix BRP for SET_BITTIMING ioctl as well

This commit is contained in:
Alan Carvalho de Assis 2017-10-27 06:15:54 -06:00 committed by Gregory Nutt
parent 0ea4d2a11d
commit b5f6d6c4f7
1 changed files with 1 additions and 1 deletions

View File

@ -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 */