mirror of https://github.com/ARMmbed/mbed-os.git
Fix coding style
parent
b99ccf65bd
commit
795bfd2288
|
@ -88,7 +88,7 @@ void can_init_freq (can_t *obj, PinName rd, PinName td, int hz)
|
||||||
// Set initial CAN frequency to 100 kb/s
|
// Set initial CAN frequency to 100 kb/s
|
||||||
if (can_frequency(obj, 100000) != 1) {
|
if (can_frequency(obj, 100000) != 1) {
|
||||||
error("Can frequency could not be set\n");
|
error("Can frequency could not be set\n");
|
||||||
};
|
}
|
||||||
|
|
||||||
uint32_t filter_number = (obj->can == CAN_1) ? 0 : 14;
|
uint32_t filter_number = (obj->can == CAN_1) ? 0 : 14;
|
||||||
can_filter(obj, 0, 0, CANStandard, filter_number);
|
can_filter(obj, 0, 0, CANStandard, filter_number);
|
||||||
|
@ -205,8 +205,7 @@ int can_frequency(can_t *obj, int f)
|
||||||
/* Get tick */
|
/* Get tick */
|
||||||
tickstart = HAL_GetTick();
|
tickstart = HAL_GetTick();
|
||||||
while ((can->MSR & CAN_MSR_INAK) != CAN_MSR_INAK) {
|
while ((can->MSR & CAN_MSR_INAK) != CAN_MSR_INAK) {
|
||||||
if((HAL_GetTick() - tickstart ) > 2)
|
if ((HAL_GetTick() - tickstart ) > 2) {
|
||||||
{
|
|
||||||
status = 0;
|
status = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -217,14 +216,13 @@ int can_frequency(can_t *obj, int f)
|
||||||
/* Get tick */
|
/* Get tick */
|
||||||
tickstart = HAL_GetTick();
|
tickstart = HAL_GetTick();
|
||||||
while ((can->MSR & CAN_MSR_INAK) == CAN_MSR_INAK) {
|
while ((can->MSR & CAN_MSR_INAK) == CAN_MSR_INAK) {
|
||||||
if((HAL_GetTick() - tickstart ) > 2)
|
if ((HAL_GetTick() - tickstart ) > 2) {
|
||||||
{
|
|
||||||
status = 0;
|
status = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
error("can ESR 0x%04x.%04x + timeout status %d", (can->ESR&0XFFFF0000)>>16, (can->ESR&0XFFFF), status);
|
error("can ESR 0x%04x.%04x + timeout status %d", (can->ESR & 0xFFFF0000) >> 16, (can->ESR & 0xFFFF), status);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
error("can init request timeout\n");
|
error("can init request timeout\n");
|
||||||
|
|
Loading…
Reference in New Issue