aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/l3gd20
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/l3gd20
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/l3gd20')
-rw-r--r--src/drivers/l3gd20/l3gd20.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/drivers/l3gd20/l3gd20.cpp b/src/drivers/l3gd20/l3gd20.cpp
index 7cebebeb4..4c3b0ce51 100644
--- a/src/drivers/l3gd20/l3gd20.cpp
+++ b/src/drivers/l3gd20/l3gd20.cpp
@@ -185,7 +185,7 @@ private:
struct hrt_call _call;
unsigned _call_interval;
- RingBuffer<gyro_report> *_reports;
+ RingBuffer *_reports;
struct gyro_scale _gyro_scale;
float _gyro_range_scale;
@@ -347,7 +347,7 @@ L3GD20::init()
goto out;
/* allocate basic report buffers */
- _reports = new RingBuffer<struct gyro_report>(2);
+ _reports = new RingBuffer(2, sizeof(gyro_report));
if (_reports == nullptr)
goto out;
@@ -421,7 +421,7 @@ L3GD20::read(struct file *filp, char *buffer, size_t buflen)
* we are careful to avoid racing with it.
*/
while (count--) {
- if (_reports->get(*gbuf)) {
+ if (_reports->get(gbuf)) {
ret += sizeof(*gbuf);
gbuf++;
}
@@ -436,7 +436,7 @@ L3GD20::read(struct file *filp, char *buffer, size_t buflen)
measure();
/* measurement will have generated a report, copy it out */
- if (_reports->get(*gbuf)) {
+ if (_reports->get(gbuf)) {
ret = sizeof(*gbuf);
}
@@ -815,7 +815,7 @@ L3GD20::measure()
report.scaling = _gyro_range_scale;
report.range_rad_s = _gyro_range_rad_s;
- _reports->force(report);
+ _reports->force(&report);
/* notify anyone waiting for data */
poll_notify(POLLIN);