1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/can: reduce scope of variable

This commit is contained in:
smlng 2018-02-22 19:13:39 +01:00
parent b46b24b34f
commit 18bccb55e3

View File

@ -514,8 +514,8 @@ int can_device_calc_bittiming(uint32_t clock, const struct can_bittiming_const *
DEBUG("invalid brp\n");
continue;
}
rate = clock / (brp * nbt);
/* current bitrate */
uint32_t rate = clock / (brp * nbt);
rate_error = max(timing->bitrate, rate) - min(timing->bitrate, rate);
if (rate_error > min_rate_error) {
DEBUG("timing->rate=%" PRIu32 ", rate=%" PRIu32 ", rate_error=%" PRIu32 " > min_rate_error=%" PRIu32 ", continuing\n",