Skip to content

Commit 795bfd2

Browse files
committed
Fix coding style
1 parent b99ccf6 commit 795bfd2

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

targets/TARGET_STM/can_api.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void can_init_freq (can_t *obj, PinName rd, PinName td, int hz)
8888
// Set initial CAN frequency to 100 kb/s
8989
if (can_frequency(obj, 100000) != 1) {
9090
error("Can frequency could not be set\n");
91-
};
91+
}
9292

9393
uint32_t filter_number = (obj->can == CAN_1) ? 0 : 14;
9494
can_filter(obj, 0, 0, CANStandard, filter_number);
@@ -205,8 +205,7 @@ int can_frequency(can_t *obj, int f)
205205
/* Get tick */
206206
tickstart = HAL_GetTick();
207207
while ((can->MSR & CAN_MSR_INAK) != CAN_MSR_INAK) {
208-
if((HAL_GetTick() - tickstart ) > 2)
209-
{
208+
if ((HAL_GetTick() - tickstart ) > 2) {
210209
status = 0;
211210
break;
212211
}
@@ -217,20 +216,19 @@ int can_frequency(can_t *obj, int f)
217216
/* Get tick */
218217
tickstart = HAL_GetTick();
219218
while ((can->MSR & CAN_MSR_INAK) == CAN_MSR_INAK) {
220-
if((HAL_GetTick() - tickstart ) > 2)
221-
{
219+
if ((HAL_GetTick() - tickstart ) > 2) {
222220
status = 0;
223221
break;
224222
}
225223
}
226-
if (status ==0) {
227-
error("can ESR 0x%04x.%04x + timeout status %d", (can->ESR&0XFFFF0000)>>16, (can->ESR&0XFFFF), status);
224+
if (status == 0) {
225+
error("can ESR 0x%04x.%04x + timeout status %d", (can->ESR & 0xFFFF0000) >> 16, (can->ESR & 0xFFFF), status);
228226
}
229227
} else {
230228
error("can init request timeout\n");
231229
}
232230
} else {
233-
status=0;
231+
status = 0;
234232
}
235233
return status;
236234
}

0 commit comments

Comments
 (0)