mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 05:53:34 +08:00
mechanical style fixups
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user