diff --git a/Tools/sitl_run.sh b/Tools/sitl_run.sh index 3c65aa4eec..6e2cbc19be 100755 --- a/Tools/sitl_run.sh +++ b/Tools/sitl_run.sh @@ -2,4 +2,4 @@ mkdir -p Build/posix_sitl.build/rootfs/fs/microsd mkdir -p Build/posix_sitl.build/rootfs/eeprom -cd Build/posix_sitl.build && ./mainapp ../../$1 +cd Build/posix_sitl.build && ./mainapp ../$1 diff --git a/makefiles/posix/config_posix_sitl.mk b/makefiles/posix/config_posix_sitl.mk index a2264a051d..6b6708a5cc 100644 --- a/makefiles/posix/config_posix_sitl.mk +++ b/makefiles/posix/config_posix_sitl.mk @@ -11,7 +11,7 @@ MODULES += drivers/pwm_out_sim MODULES += drivers/rgbled MODULES += drivers/led MODULES += modules/sensors -#MODULES += drivers/ms5611 +MODULES += drivers/ms5611 # # System commands diff --git a/src/drivers/device/i2c_posix.cpp b/src/drivers/device/i2c_posix.cpp index 9ccd6c29ca..acd35c4cce 100644 --- a/src/drivers/device/i2c_posix.cpp +++ b/src/drivers/device/i2c_posix.cpp @@ -49,7 +49,7 @@ #include #include -#define PX4_SIMULATE_I2C 1 +#define PX4_SIMULATE_I2C 0 static int simulate = PX4_SIMULATE_I2C; namespace device diff --git a/src/drivers/ms5611/ms5611_posix.cpp b/src/drivers/ms5611/ms5611_posix.cpp index 8225ec007a..d41a186c38 100644 --- a/src/drivers/ms5611/ms5611_posix.cpp +++ b/src/drivers/ms5611/ms5611_posix.cpp @@ -110,8 +110,8 @@ public: virtual int init(); - virtual ssize_t read(device::px4_dev_handle_t *handlep, char *buffer, size_t buflen); - virtual int ioctl(device::px4_dev_handle_t *handlep, int cmd, unsigned long arg); + virtual ssize_t read(device::file_t *handlep, char *buffer, size_t buflen); + virtual int ioctl(device::file_t *handlep, int cmd, unsigned long arg); /** * Diagnostics - print some basic information about the driver. @@ -126,7 +126,7 @@ protected: struct work_s _work; unsigned _measure_ticks; - RingBuffer *_reports; + ringbuffer::RingBuffer *_reports; bool _collect_phase; unsigned _measure_phase; @@ -269,7 +269,7 @@ MS5611::init() } /* allocate basic report buffers */ - _reports = new RingBuffer(2, sizeof(baro_report)); + _reports = new ringbuffer::RingBuffer(2, sizeof(baro_report)); if (_reports == nullptr) { DEVICE_DEBUG("can't get memory for reports"); @@ -337,7 +337,7 @@ out: } ssize_t -MS5611::read(device::px4_dev_handle_t *handlep, char *buffer, size_t buflen) +MS5611::read(device::file_t *handlep, char *buffer, size_t buflen) { unsigned count = buflen / sizeof(struct baro_report); struct baro_report *brp = reinterpret_cast(buffer); @@ -407,7 +407,7 @@ MS5611::read(device::px4_dev_handle_t *handlep, char *buffer, size_t buflen) } int -MS5611::ioctl(device::px4_dev_handle_t *handlep, int cmd, unsigned long arg) +MS5611::ioctl(device::file_t *handlep, int cmd, unsigned long arg) { switch (cmd) { @@ -452,7 +452,7 @@ MS5611::ioctl(device::px4_dev_handle_t *handlep, int cmd, unsigned long arg) unsigned ticks = USEC2TICK(1000000 / arg); /* check against maximum rate */ - if ((long)ticks < USEC2TICK(MS5611_CONVERSION_INTERVAL)) + if ((unsigned long)ticks < USEC2TICK(MS5611_CONVERSION_INTERVAL)) return -EINVAL; /* update interval for next measurement */ @@ -579,7 +579,7 @@ MS5611::cycle() * doing pressure measurements at something close to the desired rate. */ if ((_measure_phase != 0) && - ((long)_measure_ticks > USEC2TICK(MS5611_CONVERSION_INTERVAL))) { + ((unsigned long)_measure_ticks > USEC2TICK(MS5611_CONVERSION_INTERVAL))) { /* schedule a fresh cycle call when we are ready to measure again */ work_queue(HPWORK, @@ -829,7 +829,7 @@ struct ms5611_bus_option { #define NUM_BUS_OPTIONS (sizeof(bus_options)/sizeof(bus_options[0])) bool start_bus(struct ms5611_bus_option &bus); -struct ms5611_bus_option &find_bus(enum MS5611_BUS busid); +bool find_bus(enum MS5611_BUS busid, ms5611_bus_option &bus); int start(enum MS5611_BUS busid); int test(enum MS5611_BUS busid); int reset(enum MS5611_BUS busid); @@ -966,16 +966,18 @@ start(enum MS5611_BUS busid) /** * find a bus structure for a busid */ -struct ms5611_bus_option &find_bus(enum MS5611_BUS busid) +bool find_bus(enum MS5611_BUS busid, ms5611_bus_option &bus) { for (uint8_t i=0; i= DM_KEY_FENCE_POINTS_MAX) { - errx(1, "Sequence must be less than %d", DM_KEY_FENCE_POINTS_MAX); + PX4_WARN("Sequence must be less than %d", DM_KEY_FENCE_POINTS_MAX); } lat = strtod(argv[1], &end); @@ -311,7 +311,7 @@ Geofence::addPoint(int argc, char *argv[]) return; } - errx(1, "can't store fence point"); + PX4_WARN("can't store fence point"); } void