aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers/boards/px4fmu/px4fmu_can.c
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-10-23 23:38:45 -0700
committerpx4dev <px4@purgatory.org>2012-10-23 23:51:13 -0700
commit2fc10320697ecaa9c4e0c52d4d047424e41e6336 (patch)
tree4f18f494ab811e29dc55452f92a63fff9d271dda /apps/drivers/boards/px4fmu/px4fmu_can.c
parent34f99c7dca1995f8ddd9e8d61c4cbd7289f40e99 (diff)
downloadpx4-firmware-2fc10320697ecaa9c4e0c52d4d047424e41e6336.tar.gz
px4-firmware-2fc10320697ecaa9c4e0c52d4d047424e41e6336.tar.bz2
px4-firmware-2fc10320697ecaa9c4e0c52d4d047424e41e6336.zip
Major formatting/whitespace cleanup
Diffstat (limited to 'apps/drivers/boards/px4fmu/px4fmu_can.c')
-rw-r--r--apps/drivers/boards/px4fmu/px4fmu_can.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/apps/drivers/boards/px4fmu/px4fmu_can.c b/apps/drivers/boards/px4fmu/px4fmu_can.c
index 92d96e558..0d0b5fcd3 100644
--- a/apps/drivers/boards/px4fmu/px4fmu_can.c
+++ b/apps/drivers/boards/px4fmu/px4fmu_can.c
@@ -107,36 +107,35 @@
int can_devinit(void)
{
- static bool initialized = false;
- struct can_dev_s *can;
- int ret;
+ static bool initialized = false;
+ struct can_dev_s *can;
+ int ret;
- /* Check if we have already initialized */
+ /* Check if we have already initialized */
- if (!initialized)
- {
- /* Call stm32_caninitialize() to get an instance of the CAN interface */
+ if (!initialized) {
+ /* Call stm32_caninitialize() to get an instance of the CAN interface */
- can = stm32_caninitialize(CAN_PORT);
- if (can == NULL)
- {
- candbg("ERROR: Failed to get CAN interface\n");
- return -ENODEV;
- }
+ can = stm32_caninitialize(CAN_PORT);
- /* Register the CAN driver at "/dev/can0" */
+ if (can == NULL) {
+ candbg("ERROR: Failed to get CAN interface\n");
+ return -ENODEV;
+ }
- ret = can_register("/dev/can0", can);
- if (ret < 0)
- {
- candbg("ERROR: can_register failed: %d\n", ret);
- return ret;
- }
+ /* Register the CAN driver at "/dev/can0" */
- /* Now we are initialized */
+ ret = can_register("/dev/can0", can);
- initialized = true;
- }
+ if (ret < 0) {
+ candbg("ERROR: can_register failed: %d\n", ret);
+ return ret;
+ }
- return OK;
+ /* Now we are initialized */
+
+ initialized = true;
+ }
+
+ return OK;
}