mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 10:13:34 +08:00
Linux: enabled commander module
The commander module now compiles for Linux. state_machine_helper_linux.cpp iterates over the virtual devices vs all devices under /dev as per NuttX when disabling publishing. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -467,5 +467,13 @@ void VDev::showDevices()
|
||||
}
|
||||
}
|
||||
|
||||
const char *VDev::devList(unsigned int *next)
|
||||
{
|
||||
for (;*next<PX4_MAX_DEV; (*next)++)
|
||||
if (devmap[*next])
|
||||
return devmap[(*next)++]->name;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
} // namespace device
|
||||
|
||||
|
||||
@@ -334,6 +334,7 @@ public:
|
||||
|
||||
static VDev *getDev(const char *path);
|
||||
static void showDevices(void);
|
||||
static const char *devList(unsigned int *next);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -274,5 +274,10 @@ void px4_show_devices()
|
||||
VDev::showDevices();
|
||||
}
|
||||
|
||||
const char * px4_get_device_names(unsigned int *handle)
|
||||
{
|
||||
return VDev::devList(handle);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@
|
||||
#define LED_BLUE 0
|
||||
#define LED_SAFETY 2
|
||||
|
||||
#define LED_ON _IOC(_LED_BASE, 0)
|
||||
#define LED_OFF _IOC(_LED_BASE, 1)
|
||||
#define LED_TOGGLE _IOC(_LED_BASE, 2)
|
||||
#define LED_ON _PX4_IOC(_LED_BASE, 0)
|
||||
#define LED_OFF _PX4_IOC(_LED_BASE, 1)
|
||||
#define LED_TOGGLE _PX4_IOC(_LED_BASE, 2)
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
*/
|
||||
|
||||
#define _RGBLEDIOCBASE (0x2900)
|
||||
#define _RGBLEDIOC(_n) (_IOC(_RGBLEDIOCBASE, _n))
|
||||
#define _RGBLEDIOC(_n) (_PX4_IOC(_RGBLEDIOCBASE, _n))
|
||||
|
||||
/** play the named script in *(char *)arg, repeating forever */
|
||||
#define RGBLED_PLAY_SCRIPT_NAMED _RGBLEDIOC(1)
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
#define TONEALARM0_DEVICE_PATH "/dev/tone_alarm0"
|
||||
|
||||
#define _TONE_ALARM_BASE 0x7400
|
||||
#define TONE_SET_ALARM _IOC(_TONE_ALARM_BASE, 1)
|
||||
#define TONE_SET_ALARM _PX4_IOC(_TONE_ALARM_BASE, 1)
|
||||
|
||||
/* structure describing one note in a tone pattern */
|
||||
struct tone_note {
|
||||
|
||||
Reference in New Issue
Block a user