px4_work_queue: command line status output and shutdown empty queues

* adds a work_queue systemcmd that will bring a tree view of all active work queues and work items
 * WorkQueues now track attached WorkItems and will shutdown when the last WorkItem is detached
This commit is contained in:
Daniel Agar
2019-10-02 12:23:17 -04:00
committed by GitHub
parent cc1d86bc0b
commit 26364d44c9
167 changed files with 582 additions and 274 deletions
+1 -1
View File
@@ -165,7 +165,7 @@ usage()
// Otherwise, it will passthrough the parent AK09916
AK09916::AK09916(int bus, const char *path, enum Rotation rotation) :
I2C("AK09916", path, bus, AK09916_I2C_ADDR, 400000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_px4_mag(get_device_id(), ORB_PRIO_MAX, rotation),
_mag_reads(perf_alloc(PC_COUNT, "ak09916_mag_reads")),
_mag_errors(perf_alloc(PC_COUNT, "ak09916_mag_errors")),
+1 -1
View File
@@ -251,7 +251,7 @@ usage()
BMM150::BMM150(int bus, const char *path, enum Rotation rotation) :
I2C("BMM150", path, bus, BMM150_SLAVE_ADDRESS, BMM150_BUS_SPEED),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_running(false),
_call_interval(0),
_reports(nullptr),
+1 -1
View File
@@ -326,7 +326,7 @@ extern "C" __EXPORT int hmc5883_main(int argc, char *argv[]);
HMC5883::HMC5883(device::Device *interface, const char *path, enum Rotation rotation) :
CDev("HMC5883", path),
ScheduledWorkItem(px4::device_bus_to_wq(interface->get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(interface->get_device_id())),
_interface(interface),
_reports(nullptr),
_scale{},
+1 -1
View File
@@ -377,7 +377,7 @@ extern "C" __EXPORT int ist8310_main(int argc, char *argv[]);
IST8310::IST8310(int bus_number, int address, const char *path, enum Rotation rotation) :
I2C("IST8310", path, bus_number, address, IST8310_DEFAULT_BUS_SPEED),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_sample_perf(perf_alloc(PC_ELAPSED, "ist8310_read")),
_comms_errors(perf_alloc(PC_COUNT, "ist8310_com_err")),
_range_errors(perf_alloc(PC_COUNT, "ist8310_rng_err")),
+1 -1
View File
@@ -44,7 +44,7 @@
LIS3MDL::LIS3MDL(device::Device *interface, const char *path, enum Rotation rotation) :
CDev("LIS3MDL", path),
ScheduledWorkItem(px4::device_bus_to_wq(interface->get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(interface->get_device_id())),
_interface(interface),
_reports(nullptr),
_scale{},
@@ -63,7 +63,7 @@ static constexpr uint8_t LSM303AGR_WHO_AM_I_M = 0x40;
LSM303AGR::LSM303AGR(int bus, const char *path, uint32_t device, enum Rotation rotation) :
SPI("LSM303AGR", path, bus, device, SPIDEV_MODE3, 8 * 1000 * 1000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_mag_sample_perf(perf_alloc(PC_ELAPSED, "LSM303AGR_mag_read")),
_bad_registers(perf_alloc(PC_COUNT, "LSM303AGR_bad_reg")),
_bad_values(perf_alloc(PC_COUNT, "LSM303AGR_bad_val")),
+1 -1
View File
@@ -261,7 +261,7 @@ extern "C" __EXPORT int qmc5883_main(int argc, char *argv[]);
QMC5883::QMC5883(device::Device *interface, const char *path, enum Rotation rotation) :
CDev("QMC5883", path),
ScheduledWorkItem(px4::device_bus_to_wq(interface->get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(interface->get_device_id())),
_interface(interface),
_reports(nullptr),
_scale{},
+1 -1
View File
@@ -43,7 +43,7 @@
RM3100::RM3100(device::Device *interface, const char *path, enum Rotation rotation) :
CDev("RM3100", path),
ScheduledWorkItem(px4::device_bus_to_wq(interface->get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(interface->get_device_id())),
_interface(interface),
_reports(nullptr),
_scale{},