aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-10-20 16:53:52 -0700
committerpx4dev <px4@purgatory.org>2012-10-20 16:53:52 -0700
commitbfbd17a2fa5ef685d2d2f71ab0cedbffec6d62d7 (patch)
treeb7bf1c0ff613763ab102aaeeb0e4d0d7aba7e555 /apps/drivers
parentd2ef2afb0b53ec0e889e11f483d45b4272bba704 (diff)
downloadpx4-firmware-bfbd17a2fa5ef685d2d2f71ab0cedbffec6d62d7.tar.gz
px4-firmware-bfbd17a2fa5ef685d2d2f71ab0cedbffec6d62d7.tar.bz2
px4-firmware-bfbd17a2fa5ef685d2d2f71ab0cedbffec6d62d7.zip
Make it possible to run fmu and px4io simultaneously with full control over both sets of possible PWM outputs. First started wins.
Diffstat (limited to 'apps/drivers')
-rw-r--r--apps/drivers/device/cdev.cpp4
-rw-r--r--apps/drivers/device/device.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/apps/drivers/device/cdev.cpp b/apps/drivers/device/cdev.cpp
index 6b8bf0c2d..d07d26e82 100644
--- a/apps/drivers/device/cdev.cpp
+++ b/apps/drivers/device/cdev.cpp
@@ -74,7 +74,7 @@ static int cdev_poll(struct file *filp, struct pollfd *fds, bool setup);
* Note that we use the GNU extension syntax here because we don't get designated
* initialisers in gcc 4.6.
*/
-static const struct file_operations cdev_fops = {
+const struct file_operations CDev::fops = {
open : cdev_open,
close : cdev_close,
read : cdev_read,
@@ -118,7 +118,7 @@ CDev::init()
goto out;
// now register the driver
- ret = register_driver(_devname, &cdev_fops, 0666, (void *)this);
+ ret = register_driver(_devname, &fops, 0666, (void *)this);
if (ret != OK)
goto out;
diff --git a/apps/drivers/device/device.h b/apps/drivers/device/device.h
index 98dbf8bfb..9af678465 100644
--- a/apps/drivers/device/device.h
+++ b/apps/drivers/device/device.h
@@ -287,6 +287,12 @@ public:
protected:
/**
+ * Pointer to the default cdev file operations table; useful for
+ * registering clone devices etc.
+ */
+ static const struct file_operations fops;
+
+ /**
* Check the current state of the device for poll events from the
* perspective of the file.
*