diff options
author | px4dev <px4@purgatory.org> | 2012-08-14 08:47:04 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-08-14 08:47:04 -0700 |
commit | 34118c72ef88d33d0074914c9bf0cda0232e4940 (patch) | |
tree | 95a797b6d8d5e7dbb82fc2c44c095de10491a1a8 /apps/drivers | |
parent | 92a1fab0fd9e95737258c30fc423e839652edb72 (diff) | |
download | px4-firmware-34118c72ef88d33d0074914c9bf0cda0232e4940.tar.gz px4-firmware-34118c72ef88d33d0074914c9bf0cda0232e4940.tar.bz2 px4-firmware-34118c72ef88d33d0074914c9bf0cda0232e4940.zip |
mechanical style fixups
Diffstat (limited to 'apps/drivers')
-rw-r--r-- | apps/drivers/drv_gpio.h | 4 | ||||
-rw-r--r-- | apps/drivers/drv_mixer.h | 17 | ||||
-rw-r--r-- | apps/drivers/mpu6000/mpu6000.cpp | 10 |
3 files changed, 14 insertions, 17 deletions
diff --git a/apps/drivers/drv_gpio.h b/apps/drivers/drv_gpio.h index b9684bce1..361d731eb 100644 --- a/apps/drivers/drv_gpio.h +++ b/apps/drivers/drv_gpio.h @@ -40,10 +40,10 @@ #include <sys/ioctl.h> -/* +/* * GPIO defines come from a board-specific header, as they are shared * with board-specific logic. - * + * * The board-specific header must define: * GPIO_DEVICE_PATH * GPIO_RESET diff --git a/apps/drivers/drv_mixer.h b/apps/drivers/drv_mixer.h index 125b0d28a..fd54ed7fa 100644 --- a/apps/drivers/drv_mixer.h +++ b/apps/drivers/drv_mixer.h @@ -71,8 +71,7 @@ #define MIXERIOCRESET _MIXERIOC(1) /** simple channel scaler */ -struct mixer_scaler_s -{ +struct mixer_scaler_s { float negative_scale; float positive_scale; float offset; @@ -81,16 +80,14 @@ struct mixer_scaler_s }; /** mixer input */ -struct mixer_control_s -{ +struct mixer_control_s { uint8_t control_group; /**< group from which the input reads */ uint8_t control_index; /**< index within the control group */ struct mixer_scaler_s scaler; /**< scaling applied to the input before use */ }; /** simple mixer */ -struct mixer_simple_s -{ +struct mixer_simple_s { uint8_t control_count; /**< number of inputs */ struct mixer_scaler_s output_scaler; /**< scaling for the output */ struct mixer_control_s controls[0]; /**< actual size of the array is set by control_count */ @@ -99,20 +96,18 @@ struct mixer_simple_s #define MIXER_SIMPLE_SIZE(_icount) (sizeof(struct mixer_simple_s) + (_icount) * sizeof(struct mixer_control_s)) /** - * add a simple mixer in (struct mixer_simple_s *)arg + * add a simple mixer in (struct mixer_simple_s *)arg */ #define MIXERIOCADDSIMPLE _MIXERIOC(2) /** multirotor output definition */ -struct mixer_rotor_output_s -{ +struct mixer_rotor_output_s { float angle; /**< rotor angle clockwise from forward in radians */ float distance; /**< motor distance from centre in arbitrary units */ }; /** multirotor mixer */ -struct mixer_multirotor_s -{ +struct mixer_multirotor_s { uint8_t rotor_count; struct mixer_control_s controls[4]; /**< controls are roll, pitch, yaw, thrust */ struct mixer_rotor_output_s rotors[0]; /**< actual size of the array is set by rotor_count */ diff --git a/apps/drivers/mpu6000/mpu6000.cpp b/apps/drivers/mpu6000/mpu6000.cpp index 70e3e41c5..7576fc1d9 100644 --- a/apps/drivers/mpu6000/mpu6000.cpp +++ b/apps/drivers/mpu6000/mpu6000.cpp @@ -367,7 +367,7 @@ MPU6000::init() // FS & DLPF FS=2000¼/s, DLPF = 98Hz (low pass filter) write_reg(MPUREG_CONFIG, BITS_DLPF_CFG_98HZ); usleep(1000); - write_reg(MPUREG_GYRO_CONFIG,BITS_FS_2000DPS); // Gyro scale 2000¼/s + write_reg(MPUREG_GYRO_CONFIG, BITS_FS_2000DPS); // Gyro scale 2000¼/s usleep(1000); // product-specific scaling @@ -390,15 +390,16 @@ MPU6000::init() case MPU6000_REV_D9: case MPU6000_REV_D10: // Accel scale 8g (4096 LSB/g) - write_reg(MPUREG_ACCEL_CONFIG,2<<3); + write_reg(MPUREG_ACCEL_CONFIG, 2 << 3); break; } + usleep(1000); // INT CFG => Interrupt on Data Ready - write_reg(MPUREG_INT_ENABLE,BIT_RAW_RDY_EN); // INT: Raw data ready + write_reg(MPUREG_INT_ENABLE, BIT_RAW_RDY_EN); // INT: Raw data ready usleep(1000); - write_reg(MPUREG_INT_PIN_CFG,BIT_INT_ANYRD_2CLEAR); // INT: Clear on any read + write_reg(MPUREG_INT_PIN_CFG, BIT_INT_ANYRD_2CLEAR); // INT: Clear on any read usleep(1000); // Oscillator set @@ -898,6 +899,7 @@ mpu6000_main(int argc, char *argv[]) g_dev = nullptr; return -EIO; } + return OK; } |