mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-07 09:13:32 +08:00
Make it possible to run fmu and px4io simultaneously with full control over both sets of possible PWM outputs. First started wins.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -286,6 +286,12 @@ public:
|
||||
bool is_open() { return _open_count > 0; }
|
||||
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user