aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/ms5611
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-09-09 22:23:48 -0700
committerLorenz Meier <lm@inf.ethz.ch>2013-09-12 00:53:08 +0200
commitcefc7ac00e55ade983562a081c3ccda8030e95ce (patch)
treef2353bfb6714af357d509c3e99aa97588255f485 /src/drivers/ms5611
parenta5821d29281243385363745d1725a6b3210f7f96 (diff)
downloadpx4-firmware-cefc7ac00e55ade983562a081c3ccda8030e95ce.tar.gz
px4-firmware-cefc7ac00e55ade983562a081c3ccda8030e95ce.tar.bz2
px4-firmware-cefc7ac00e55ade983562a081c3ccda8030e95ce.zip
Rework the ringbuffer class so that it's not templated, and refactor its clients so they aren't dancing around the linker anymore.
Diffstat (limited to 'src/drivers/ms5611')
-rw-r--r--src/drivers/ms5611/ms5611.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/drivers/ms5611/ms5611.cpp b/src/drivers/ms5611/ms5611.cpp
index 3f57cd68f..1c8a4d776 100644
--- a/src/drivers/ms5611/ms5611.cpp
+++ b/src/drivers/ms5611/ms5611.cpp
@@ -115,7 +115,7 @@ protected:
struct work_s _work;
unsigned _measure_ticks;
- RingBuffer<struct baro_report> *_reports;
+ RingBuffer *_reports;
bool _collect_phase;
unsigned _measure_phase;
@@ -241,7 +241,7 @@ MS5611::init()
}
/* allocate basic report buffers */
- _reports = new RingBuffer<struct baro_report>(2);
+ _reports = new RingBuffer(2, sizeof(baro_report));
if (_reports == nullptr) {
debug("can't get memory for reports");
@@ -285,7 +285,7 @@ MS5611::read(struct file *filp, char *buffer, size_t buflen)
* we are careful to avoid racing with them.
*/
while (count--) {
- if (_reports->get(*brp)) {
+ if (_reports->get(brp)) {
ret += sizeof(*brp);
brp++;
}
@@ -327,7 +327,7 @@ MS5611::read(struct file *filp, char *buffer, size_t buflen)
}
/* state machine will have generated a report, copy it out */
- if (_reports->get(*brp))
+ if (_reports->get(brp))
ret = sizeof(*brp);
} while (0);
@@ -664,7 +664,7 @@ MS5611::collect()
/* publish it */
orb_publish(ORB_ID(sensor_baro), _baro_topic, &report);
- if (_reports->force(report)) {
+ if (_reports->force(&report)) {
perf_count(_buffer_overflows);
}