mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-04 00:01:36 +08:00
Drivers: fix formatting
This commit is contained in:
@@ -30,10 +30,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file board_config.h
|
* @file board_config.h
|
||||||
*
|
*
|
||||||
* PX4IO hardware definitions.
|
* PX4IO hardware definitions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -59,11 +59,11 @@
|
|||||||
/* LEDs */
|
/* LEDs */
|
||||||
|
|
||||||
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|\
|
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|\
|
||||||
GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN14)
|
GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN14)
|
||||||
#define GPIO_LED2 (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|\
|
#define GPIO_LED2 (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|\
|
||||||
GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN15)
|
GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN15)
|
||||||
#define GPIO_LED3 (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|\
|
#define GPIO_LED3 (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|\
|
||||||
GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10)
|
GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10)
|
||||||
|
|
||||||
/* Safety switch button *************************************************************/
|
/* Safety switch button *************************************************************/
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
#define GPIO_ADC_VBATT (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
|
#define GPIO_ADC_VBATT (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
|
||||||
#define GPIO_ADC_IN5 (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
|
#define GPIO_ADC_IN5 (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* High-resolution timer
|
* High-resolution timer
|
||||||
*/
|
*/
|
||||||
#define HRT_TIMER 1 /* use timer1 for the HRT */
|
#define HRT_TIMER 1 /* use timer1 for the HRT */
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
#ifdef __PX4_POSIX
|
#ifdef __PX4_POSIX
|
||||||
|
|
||||||
#ifndef SIOCDEVPRIVATE
|
#ifndef SIOCDEVPRIVATE
|
||||||
#define SIOCDEVPRIVATE 1
|
#define SIOCDEVPRIVATE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DIOC_GETPRIV SIOCDEVPRIVATE
|
#define DIOC_GETPRIV SIOCDEVPRIVATE
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ __BEGIN_DECLS
|
|||||||
#define pwm_output_values output_pwm_s
|
#define pwm_output_values output_pwm_s
|
||||||
|
|
||||||
#ifndef PWM_OUTPUT_MAX_CHANNELS
|
#ifndef PWM_OUTPUT_MAX_CHANNELS
|
||||||
#define PWM_OUTPUT_MAX_CHANNELS output_pwm_s::PWM_OUTPUT_MAX_CHANNELS
|
#define PWM_OUTPUT_MAX_CHANNELS output_pwm_s::PWM_OUTPUT_MAX_CHANNELS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
CH_VOLTAGE_LEFT = 0,
|
CH_VOLTAGE_LEFT = 0,
|
||||||
CH_VOLTAGE_RIGHT
|
CH_VOLTAGE_RIGHT
|
||||||
};
|
};
|
||||||
|
|
||||||
/** motors */
|
/** motors */
|
||||||
enum e_motor {
|
enum e_motor {
|
||||||
MOTOR_1 = 0,
|
MOTOR_1 = 0,
|
||||||
@@ -70,15 +70,15 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
* @param deviceName the name of the
|
* @param deviceName the name of the
|
||||||
* serial port e.g. "/dev/ttyS2"
|
* serial port e.g. "/dev/ttyS2"
|
||||||
* @param address the adddress of the motor
|
* @param address the adddress of the motor
|
||||||
* (selectable on roboclaw)
|
* (selectable on roboclaw)
|
||||||
* @param pulsesPerRev # of encoder
|
* @param pulsesPerRev # of encoder
|
||||||
* pulses per revolution of wheel
|
* pulses per revolution of wheel
|
||||||
*/
|
*/
|
||||||
RoboClaw(const char *deviceName, uint16_t address,
|
RoboClaw(const char *deviceName, uint16_t address,
|
||||||
uint16_t pulsesPerRev);
|
uint16_t pulsesPerRev);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deconstructor
|
* deconstructor
|
||||||
@@ -153,7 +153,7 @@ private:
|
|||||||
|
|
||||||
// advanced motor control
|
// advanced motor control
|
||||||
CMD_READ_SPEED_HIRES_1 = 30,
|
CMD_READ_SPEED_HIRES_1 = 30,
|
||||||
CMD_READ_SPEED_HIRES_2 = 31,
|
CMD_READ_SPEED_HIRES_2 = 31,
|
||||||
CMD_SIGNED_DUTYCYCLE_1 = 32,
|
CMD_SIGNED_DUTYCYCLE_1 = 32,
|
||||||
CMD_SIGNED_DUTYCYCLE_2 = 33,
|
CMD_SIGNED_DUTYCYCLE_2 = 33,
|
||||||
};
|
};
|
||||||
@@ -181,12 +181,12 @@ private:
|
|||||||
int16_t _motor2Overflow;
|
int16_t _motor2Overflow;
|
||||||
|
|
||||||
// private methods
|
// private methods
|
||||||
uint16_t _sumBytes(uint8_t * buf, size_t n);
|
uint16_t _sumBytes(uint8_t *buf, size_t n);
|
||||||
int _sendCommand(e_command cmd, uint8_t * data, size_t n_data, uint16_t & prev_sum);
|
int _sendCommand(e_command cmd, uint8_t *data, size_t n_data, uint16_t &prev_sum);
|
||||||
};
|
};
|
||||||
|
|
||||||
// unit testing
|
// unit testing
|
||||||
int roboclawTest(const char *deviceName, uint8_t address,
|
int roboclawTest(const char *deviceName, uint8_t address,
|
||||||
uint16_t pulsesPerRev);
|
uint16_t pulsesPerRev);
|
||||||
|
|
||||||
// vi:noet:smarttab:autoindent:ts=4:sw=4:tw=78
|
// vi:noet:smarttab:autoindent:ts=4:sw=4:tw=78
|
||||||
|
|||||||
Reference in New Issue
Block a user