Move member variable initialization out of the constructor list to variable declarations, format whitespaces/tabs in sf1xx.cpp.

This commit is contained in:
mcsauder
2019-02-25 11:56:50 -07:00
committed by Daniel Agar
parent f229444722
commit ca92b8016d
+22 -32
View File
@@ -103,24 +103,6 @@ protected:
virtual int probe();
private:
uint8_t _rotation;
float _min_distance;
float _max_distance;
int _conversion_interval;
work_s _work{};
ringbuffer::RingBuffer *_reports;
bool _sensor_ok;
int _measure_ticks;
int _class_instance;
int _orb_class_instance;
orb_advert_t _distance_sensor_topic;
perf_counter_t _sample_perf;
perf_counter_t _comms_errors;
/**
* Test whether the device supported by the driver is present at a
* specific address.
@@ -160,15 +142,35 @@ private:
void cycle();
int measure();
int collect();
/**
* Static trampoline from the workq context; because we don't have a
* generic workq wrapper yet.
* generic workqueue wrapper yet.
*
* @param arg Instance pointer for the driver that is polling.
*/
static void cycle_trampoline(void *arg);
bool _sensor_ok{false};
int _class_instance{-1};
int _conversion_interval{-1};
int _measure_ticks{0};
int _orb_class_instance{-1};
float _max_distance{-1.0f};
float _min_distance{-1.0f};
uint8_t _rotation{0};
work_s _work{};
ringbuffer::RingBuffer *_reports{nullptr};
orb_advert_t _distance_sensor_topic{nullptr};
perf_counter_t _sample_perf{perf_alloc(PC_ELAPSED, "sf1xx_read")};
perf_counter_t _comms_errors{perf_alloc(PC_COUNT, "sf1xx_com_err")};
};
/*
@@ -178,19 +180,7 @@ extern "C" __EXPORT int sf1xx_main(int argc, char *argv[]);
SF1XX::SF1XX(uint8_t rotation, int bus, int address) :
I2C("SF1XX", SF1XX_DEVICE_PATH, bus, address, 400000),
_rotation(rotation),
_min_distance(-1.0f),
_max_distance(-1.0f),
_conversion_interval(-1),
_reports(nullptr),
_sensor_ok(false),
_measure_ticks(0),
_class_instance(-1),
_orb_class_instance(-1),
_distance_sensor_topic(nullptr),
_sample_perf(perf_alloc(PC_ELAPSED, "sf1xx_read")),
_comms_errors(perf_alloc(PC_COUNT, "sf1xx_com_err"))
_rotation(rotation)
{
}