Style fix: ETS_AIRSPEED > ETSAirspeed

This commit is contained in:
Simon Wilks 2013-04-23 08:49:33 +02:00
parent 24630f15b6
commit 5b60991c63
1 changed files with 23 additions and 23 deletions

View File

@ -100,11 +100,11 @@ static const int ERROR = -1;
# error This requires CONFIG_SCHED_WORKQUEUE. # error This requires CONFIG_SCHED_WORKQUEUE.
#endif #endif
class ETS_AIRSPEED : public device::I2C class ETSAirspeed : public device::I2C
{ {
public: public:
ETS_AIRSPEED(int bus, int address = I2C_ADDRESS); ETSAirspeed(int bus, int address = I2C_ADDRESS);
virtual ~ETS_AIRSPEED(); virtual ~ETSAirspeed();
virtual int init(); virtual int init();
@ -186,8 +186,8 @@ private:
*/ */
extern "C" __EXPORT int ets_airspeed_main(int argc, char *argv[]); extern "C" __EXPORT int ets_airspeed_main(int argc, char *argv[]);
ETS_AIRSPEED::ETS_AIRSPEED(int bus, int address) : ETSAirspeed::ETSAirspeed(int bus, int address) :
I2C("ETS_AIRSPEED", AIRSPEED_DEVICE_PATH, bus, address, 100000), I2C("ETSAirspeed", AIRSPEED_DEVICE_PATH, bus, address, 100000),
_num_reports(0), _num_reports(0),
_next_report(0), _next_report(0),
_oldest_report(0), _oldest_report(0),
@ -208,7 +208,7 @@ ETS_AIRSPEED::ETS_AIRSPEED(int bus, int address) :
memset(&_work, 0, sizeof(_work)); memset(&_work, 0, sizeof(_work));
} }
ETS_AIRSPEED::~ETS_AIRSPEED() ETSAirspeed::~ETSAirspeed()
{ {
/* make sure we are truly inactive */ /* make sure we are truly inactive */
stop(); stop();
@ -219,7 +219,7 @@ ETS_AIRSPEED::~ETS_AIRSPEED()
} }
int int
ETS_AIRSPEED::init() ETSAirspeed::init()
{ {
int ret = ERROR; int ret = ERROR;
@ -253,13 +253,13 @@ out:
} }
int int
ETS_AIRSPEED::probe() ETSAirspeed::probe()
{ {
return measure(); return measure();
} }
int int
ETS_AIRSPEED::ioctl(struct file *filp, int cmd, unsigned long arg) ETSAirspeed::ioctl(struct file *filp, int cmd, unsigned long arg)
{ {
switch (cmd) { switch (cmd) {
@ -363,7 +363,7 @@ ETS_AIRSPEED::ioctl(struct file *filp, int cmd, unsigned long arg)
} }
ssize_t ssize_t
ETS_AIRSPEED::read(struct file *filp, char *buffer, size_t buflen) ETSAirspeed::read(struct file *filp, char *buffer, size_t buflen)
{ {
unsigned count = buflen / sizeof(struct differential_pressure_s); unsigned count = buflen / sizeof(struct differential_pressure_s);
int ret = 0; int ret = 0;
@ -422,7 +422,7 @@ ETS_AIRSPEED::read(struct file *filp, char *buffer, size_t buflen)
} }
int int
ETS_AIRSPEED::measure() ETSAirspeed::measure()
{ {
int ret; int ret;
@ -444,7 +444,7 @@ ETS_AIRSPEED::measure()
} }
int int
ETS_AIRSPEED::collect() ETSAirspeed::collect()
{ {
int ret = -EIO; int ret = -EIO;
@ -503,14 +503,14 @@ ETS_AIRSPEED::collect()
} }
void void
ETS_AIRSPEED::start() ETSAirspeed::start()
{ {
/* reset the report ring and state machine */ /* reset the report ring and state machine */
_collect_phase = false; _collect_phase = false;
_oldest_report = _next_report = 0; _oldest_report = _next_report = 0;
/* schedule a cycle to start things */ /* schedule a cycle to start things */
work_queue(HPWORK, &_work, (worker_t)&ETS_AIRSPEED::cycle_trampoline, this, 1); work_queue(HPWORK, &_work, (worker_t)&ETSAirspeed::cycle_trampoline, this, 1);
/* notify about state change */ /* notify about state change */
struct subsystem_info_s info = { struct subsystem_info_s info = {
@ -528,21 +528,21 @@ ETS_AIRSPEED::start()
} }
void void
ETS_AIRSPEED::stop() ETSAirspeed::stop()
{ {
work_cancel(HPWORK, &_work); work_cancel(HPWORK, &_work);
} }
void void
ETS_AIRSPEED::cycle_trampoline(void *arg) ETSAirspeed::cycle_trampoline(void *arg)
{ {
ETS_AIRSPEED *dev = (ETS_AIRSPEED *)arg; ETSAirspeed *dev = (ETSAirspeed *)arg;
dev->cycle(); dev->cycle();
} }
void void
ETS_AIRSPEED::cycle() ETSAirspeed::cycle()
{ {
/* collection phase? */ /* collection phase? */
if (_collect_phase) { if (_collect_phase) {
@ -566,7 +566,7 @@ ETS_AIRSPEED::cycle()
/* schedule a fresh cycle call when we are ready to measure again */ /* schedule a fresh cycle call when we are ready to measure again */
work_queue(HPWORK, work_queue(HPWORK,
&_work, &_work,
(worker_t)&ETS_AIRSPEED::cycle_trampoline, (worker_t)&ETSAirspeed::cycle_trampoline,
this, this,
_measure_ticks - USEC2TICK(CONVERSION_INTERVAL)); _measure_ticks - USEC2TICK(CONVERSION_INTERVAL));
@ -584,13 +584,13 @@ ETS_AIRSPEED::cycle()
/* schedule a fresh cycle call when the measurement is done */ /* schedule a fresh cycle call when the measurement is done */
work_queue(HPWORK, work_queue(HPWORK,
&_work, &_work,
(worker_t)&ETS_AIRSPEED::cycle_trampoline, (worker_t)&ETSAirspeed::cycle_trampoline,
this, this,
USEC2TICK(CONVERSION_INTERVAL)); USEC2TICK(CONVERSION_INTERVAL));
} }
void void
ETS_AIRSPEED::print_info() ETSAirspeed::print_info()
{ {
perf_print_counter(_sample_perf); perf_print_counter(_sample_perf);
perf_print_counter(_comms_errors); perf_print_counter(_comms_errors);
@ -612,7 +612,7 @@ namespace ets_airspeed
#endif #endif
const int ERROR = -1; const int ERROR = -1;
ETS_AIRSPEED *g_dev; ETSAirspeed *g_dev;
void start(int i2c_bus); void start(int i2c_bus);
void stop(); void stop();
@ -632,7 +632,7 @@ start(int i2c_bus)
errx(1, "already started"); errx(1, "already started");
/* create the driver */ /* create the driver */
g_dev = new ETS_AIRSPEED(i2c_bus); g_dev = new ETSAirspeed(i2c_bus);
if (g_dev == nullptr) if (g_dev == nullptr)
goto fail; goto fail;