mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 15:30:35 +08:00
drivers fix missing field initializers
This commit is contained in:
committed by
Nuno Marques
parent
35e15ed540
commit
79869c848f
@@ -247,7 +247,6 @@ usage()
|
||||
|
||||
BMM150 :: BMM150(int bus, const char *path, bool external, enum Rotation rotation) :
|
||||
I2C("BMM150", path, bus, BMM150_SLAVE_ADDRESS, BMM150_BUS_SPEED),
|
||||
_work{},
|
||||
_external(false),
|
||||
_running(false),
|
||||
_call_interval(0),
|
||||
@@ -279,8 +278,7 @@ BMM150 :: BMM150(int bus, const char *path, bool external, enum Rotation rotatio
|
||||
_comms_errors(perf_alloc(PC_COUNT, "bmp280_comms_errors")),
|
||||
_duplicates(perf_alloc(PC_COUNT, "bmm150_duplicates")),
|
||||
_rotation(rotation),
|
||||
_got_duplicate(false),
|
||||
_last_report{0}
|
||||
_got_duplicate(false)
|
||||
{
|
||||
_device_id.devid_s.devtype = DRV_MAG_DEVTYPE_BMM150;
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ protected:
|
||||
virtual int probe();
|
||||
|
||||
private:
|
||||
work_s _work;
|
||||
work_s _work{};
|
||||
bool _external;
|
||||
|
||||
bool _running;
|
||||
@@ -228,6 +228,7 @@ private:
|
||||
unsigned _call_interval;
|
||||
|
||||
|
||||
mag_report _report {};
|
||||
ringbuffer::RingBuffer *_reports;
|
||||
|
||||
bool _collect_phase;
|
||||
@@ -268,7 +269,7 @@ private:
|
||||
enum Rotation _rotation;
|
||||
bool _got_duplicate;
|
||||
|
||||
struct mag_report _last_report; /**< used for info() */
|
||||
mag_report _last_report {}; /**< used for info() */
|
||||
|
||||
int init_trim_registers(void);
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ read : cdev_read,
|
||||
write : cdev_write,
|
||||
seek : cdev_seek,
|
||||
ioctl : cdev_ioctl,
|
||||
poll : cdev_poll,
|
||||
poll : cdev_poll
|
||||
};
|
||||
|
||||
CDev::CDev(const char *name,
|
||||
|
||||
@@ -153,7 +153,7 @@ protected:
|
||||
Device *_interface;
|
||||
|
||||
private:
|
||||
work_s _work;
|
||||
work_s _work{};
|
||||
unsigned _measure_ticks;
|
||||
|
||||
ringbuffer::RingBuffer *_reports;
|
||||
@@ -177,7 +177,7 @@ private:
|
||||
|
||||
enum Rotation _rotation;
|
||||
|
||||
struct mag_report _last_report; /**< used for info() */
|
||||
struct mag_report _last_report {}; /**< used for info() */
|
||||
|
||||
uint8_t _range_bits;
|
||||
uint8_t _conf_reg;
|
||||
@@ -345,7 +345,6 @@ extern "C" __EXPORT int hmc5883_main(int argc, char *argv[]);
|
||||
HMC5883::HMC5883(device::Device *interface, const char *path, enum Rotation rotation) :
|
||||
CDev("HMC5883", path),
|
||||
_interface(interface),
|
||||
_work{},
|
||||
_measure_ticks(0),
|
||||
_reports(nullptr),
|
||||
_scale{},
|
||||
@@ -362,7 +361,6 @@ HMC5883::HMC5883(device::Device *interface, const char *path, enum Rotation rota
|
||||
_sensor_ok(false),
|
||||
_calibrated(false),
|
||||
_rotation(rotation),
|
||||
_last_report{0},
|
||||
_range_bits(0),
|
||||
_conf_reg(0),
|
||||
_temperature_counter(0),
|
||||
|
||||
@@ -166,7 +166,7 @@ private:
|
||||
|
||||
enum Rotation _rotation;
|
||||
|
||||
struct mag_report _last_report; /**< used for info() */
|
||||
struct mag_report _last_report {}; /**< used for info() */
|
||||
|
||||
uint8_t _range_bits;
|
||||
uint8_t _cntl_reg1;
|
||||
@@ -341,7 +341,6 @@ LIS3MDL::LIS3MDL(device::Device *interface, const char *path, enum Rotation rota
|
||||
_sensor_ok(false),
|
||||
_calibrated(false),
|
||||
_rotation(rotation),
|
||||
_last_report{0},
|
||||
_range_bits(0),
|
||||
_cntl_reg1(0),
|
||||
_cntl_reg4(0),
|
||||
|
||||
@@ -895,14 +895,14 @@ ToneAlarm::ioctl(file *filp, int cmd, unsigned long arg)
|
||||
{
|
||||
int result = OK;
|
||||
|
||||
DEVICE_DEBUG("ioctl %i %u", cmd, arg);
|
||||
DEVICE_DEBUG("ioctl %i %lu", cmd, arg);
|
||||
|
||||
// irqstate_t flags = px4_enter_critical_section();
|
||||
|
||||
/* decide whether to increase the alarm level to cmd or leave it alone */
|
||||
switch (cmd) {
|
||||
case TONE_SET_ALARM:
|
||||
DEVICE_DEBUG("TONE_SET_ALARM %u", arg);
|
||||
DEVICE_DEBUG("TONE_SET_ALARM %lu", arg);
|
||||
|
||||
if (arg < TONE_NUMBER_OF_TUNES) {
|
||||
if (arg == TONE_STOP_TUNE) {
|
||||
|
||||
@@ -34,6 +34,7 @@ px4_add_module(
|
||||
MODULE drivers__tap_esc
|
||||
MAIN tap_esc
|
||||
COMPILE_FLAGS
|
||||
-Wno-missing-field-initializers
|
||||
SRCS
|
||||
tap_esc.cpp
|
||||
tap_esc_common.cpp
|
||||
|
||||
Reference in New Issue
Block a user