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
@@ -104,7 +104,7 @@ private:
ADC::ADC(uint32_t base_address, uint32_t channels) :
CDev(ADC0_DEVICE_PATH),
ScheduledWorkItem(px4::wq_configurations::hp_default),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default),
_sample_perf(perf_alloc(PC_ELAPSED, "adc_samples")),
_base_address(base_address)
{
+1 -1
View File
@@ -112,7 +112,7 @@ extern "C" __EXPORT int bmp280_main(int argc, char *argv[]);
BMP280::BMP280(bmp280::IBMP280 *interface, const char *path) :
CDev(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),
_running(false),
_report_interval(0),
+1 -1
View File
@@ -44,7 +44,7 @@
LPS22HB::LPS22HB(device::Device *interface, const char *path) :
CDev(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),
_sample_perf(perf_alloc(PC_ELAPSED, "lps22hb_read")),
_comms_errors(perf_alloc(PC_COUNT, "lps22hb_comms_errors"))
+1 -1
View File
@@ -261,7 +261,7 @@ extern "C" __EXPORT int lps25h_main(int argc, char *argv[]);
LPS25H::LPS25H(device::Device *interface, const char *path) :
CDev(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),
_sample_perf(perf_alloc(PC_ELAPSED, "lps25h_read")),
_comms_errors(perf_alloc(PC_COUNT, "lps25h_comms_errors"))
@@ -148,7 +148,7 @@ extern "C" __EXPORT int mpl3115a2_main(int argc, char *argv[]);
MPL3115A2::MPL3115A2(device::Device *interface, const char *path) :
CDev(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),
_measure_interval(0),
_reports(nullptr),
+1 -1
View File
@@ -183,7 +183,7 @@ extern "C" __EXPORT int ms5611_main(int argc, char *argv[]);
MS5611::MS5611(device::Device *interface, ms5611::prom_u &prom_buf, const char *path,
enum MS56XX_DEVICE_TYPES device_type) :
CDev(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),
_prom(prom_buf.s),
_reports(nullptr),
+1 -1
View File
@@ -46,7 +46,7 @@
extern "C" __EXPORT int batt_smbus_main(int argc, char *argv[]);
BATT_SMBUS::BATT_SMBUS(SMBus *interface, const char *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),
_cycle(perf_alloc(PC_ELAPSED, "batt_smbus_cycle")),
_batt_topic(nullptr),
@@ -49,7 +49,7 @@ CameraCapture *g_camera_capture{nullptr};
}
CameraCapture::CameraCapture() :
ScheduledWorkItem(px4::wq_configurations::lp_default)
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::lp_default)
{
memset(&_work_publisher, 0, sizeof(_work_publisher));
@@ -233,7 +233,7 @@ CameraTrigger *g_camera_trigger;
}
CameraTrigger::CameraTrigger() :
ScheduledWorkItem(px4::wq_configurations::lp_default),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::lp_default),
_engagecall {},
_disengagecall {},
_engage_turn_on_off_call {},
@@ -84,7 +84,7 @@ static constexpr unsigned char crc_lsb_vector[] = {
};
CM8JL65::CM8JL65(const char *port, uint8_t rotation) :
ScheduledWorkItem(px4::wq_configurations::hp_default),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default),
_px4_rangefinder(0 /* TODO: device ids */, ORB_PRIO_DEFAULT, rotation)
{
// Store the port name.
@@ -174,7 +174,7 @@ private:
LeddarOne::LeddarOne(const char *device_path, const char *serial_port, uint8_t device_orientation):
CDev(device_path),
ScheduledWorkItem(px4::wq_configurations::hp_default),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default),
_px4_rangefinder(0 /* device id not yet used */, ORB_PRIO_DEFAULT, device_orientation)
{
_serial_port = strdup(serial_port);
@@ -52,7 +52,6 @@ LidarLite::LidarLite(const uint8_t rotation) :
LidarLite::~LidarLite()
{
perf_free(_sample_perf);
perf_free(_sample_interval_perf);
perf_free(_comms_errors);
perf_free(_sensor_resets);
perf_free(_sensor_zero_resets);
@@ -62,7 +61,6 @@ void
LidarLite::print_info()
{
perf_print_counter(_sample_perf);
perf_print_counter(_sample_interval_perf);
perf_print_counter(_comms_errors);
perf_print_counter(_sensor_resets);
perf_print_counter(_sensor_zero_resets);
@@ -90,7 +90,6 @@ protected:
PX4Rangefinder _px4_rangefinder;
perf_counter_t _comms_errors{perf_alloc(PC_COUNT, "ll40ls: comms errors")};
perf_counter_t _sample_interval_perf{perf_alloc(PC_ELAPSED, "ll40ls: interval")};
perf_counter_t _sample_perf{perf_alloc(PC_ELAPSED, "ll40ls: read")};
perf_counter_t _sensor_resets{perf_alloc(PC_COUNT, "ll40ls: resets")};
perf_counter_t _sensor_zero_resets{perf_alloc(PC_COUNT, "ll40ls: zero resets")};
@@ -44,7 +44,7 @@
LidarLiteI2C::LidarLiteI2C(const int bus, const uint8_t rotation, const int address) :
LidarLite(rotation),
I2C("LL40LS", nullptr, bus, address, 100000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id()))
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id()))
{
// up the retries since the device misses the first measure attempts
_retries = 3;
@@ -46,7 +46,7 @@
LidarLitePWM::LidarLitePWM(const uint8_t rotation) :
LidarLite(rotation),
ScheduledWorkItem(px4::wq_configurations::hp_default)
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default)
{
}
@@ -225,7 +225,7 @@ private:
MappyDot::MappyDot(const int bus) :
I2C("MappyDot", MAPPYDOT_DEVICE_PATH, bus, MAPPYDOT_BASE_ADDR, MAPPYDOT_BUS_CLOCK),
ModuleParams(nullptr),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id()))
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id()))
{}
MappyDot::~MappyDot()
@@ -181,7 +181,7 @@ private:
MB12XX::MB12XX(const int bus) :
I2C("MB12xx", MB12XX_DEVICE_PATH, bus, MB12XX_BASE_ADDR, MB12XX_BUS_SPEED),
ModuleParams(nullptr),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id()))
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id()))
{
}
+1 -1
View File
@@ -157,7 +157,7 @@ extern "C" __EXPORT int sf0x_main(int argc, char *argv[]);
SF0X::SF0X(const char *port, uint8_t rotation) :
CDev(RANGE_FINDER0_DEVICE_PATH),
ScheduledWorkItem(px4::wq_configurations::hp_default),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default),
_rotation(rotation),
_min_distance(0.30f),
_max_distance(40.0f),
+1 -1
View File
@@ -167,7 +167,7 @@ extern "C" __EXPORT int sf1xx_main(int argc, char *argv[]);
SF1XX::SF1XX(uint8_t rotation, int bus, int address) :
I2C("SF1XX", SF1XX_DEVICE_PATH, bus, address, 400000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_rotation(rotation)
{
}
+1 -1
View File
@@ -172,7 +172,7 @@ extern "C" __EXPORT int srf02_main(int argc, char *argv[]);
SRF02::SRF02(uint8_t rotation, int bus, int address) :
I2C("SRF02", SRF02_DEVICE_PATH, bus, address, 100000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_rotation(rotation)
{
}
@@ -192,7 +192,7 @@ static uint8_t crc8(uint8_t *p, uint8_t len)
TERARANGER::TERARANGER(const int bus, const uint8_t orientation, const int address) :
I2C("TERARANGER", TERARANGER_DEVICE_PATH, bus, address, 100000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_orientation(orientation)
{
// up the retries since the device misses the first measure attempts
@@ -34,7 +34,7 @@
#include "TFMINI.hpp"
TFMINI::TFMINI(const char *port, uint8_t rotation) :
ScheduledWorkItem(px4::wq_configurations::hp_default),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default),
_px4_rangefinder(0 /* TODO: device id */, ORB_PRIO_DEFAULT, rotation)
{
// store port name
@@ -172,7 +172,7 @@ private:
Radar::Radar(const char *port, uint8_t rotation) :
CDev(RANGE_FINDER0_DEVICE_PATH),
ScheduledWorkItem(px4::wq_configurations::hp_default),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default),
_rotation(rotation)
{
/* store port name */
@@ -167,7 +167,7 @@ private:
VL53LXX::VL53LXX(uint8_t rotation, int bus, int address) :
I2C("VL53LXX", VL53LXX_DEVICE_PATH, bus, address, 400000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_rotation(rotation)
{
// Allow 3 retries as the device typically misses the first measure attempts.
+1 -1
View File
@@ -51,7 +51,7 @@
Heater::Heater() :
ModuleParams(nullptr),
ScheduledWorkItem(px4::wq_configurations::lp_default)
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::lp_default)
{
px4_arch_configgpio(GPIO_HEATER_OUTPUT);
px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, 0);
+1 -5
View File
@@ -39,7 +39,7 @@
ADIS16448::ADIS16448(int bus, uint32_t device, enum Rotation rotation) :
SPI("ADIS16448", nullptr, bus, device, SPIDEV_MODE3, 1000000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_px4_accel(get_device_id(), ORB_PRIO_MAX, rotation),
_px4_baro(get_device_id(), ORB_PRIO_MAX),
_px4_gyro(get_device_id(), ORB_PRIO_MAX, rotation),
@@ -64,7 +64,6 @@ ADIS16448::~ADIS16448()
// Delete the perf counter.
perf_free(_perf_read);
perf_free(_perf_read_interval);
perf_free(_perf_transfer);
perf_free(_perf_bad_transfer);
perf_free(_perf_crc_bad);
@@ -314,7 +313,6 @@ void
ADIS16448::print_info()
{
perf_print_counter(_perf_read);
perf_print_counter(_perf_read_interval);
perf_print_counter(_perf_transfer);
perf_print_counter(_perf_bad_transfer);
perf_print_counter(_perf_crc_bad);
@@ -444,8 +442,6 @@ convert12BitToINT16(uint16_t word)
int
ADIS16448::measure()
{
perf_count(_perf_read_interval);
// Start measuring.
perf_begin(_perf_read);
-1
View File
@@ -211,7 +211,6 @@ private:
static constexpr float _sample_rate{ADIS16448_ACCEL_GYRO_UPDATE_RATE};
perf_counter_t _perf_read{perf_counter_t(perf_alloc(PC_ELAPSED, "ADIS16448: read"))};
perf_counter_t _perf_read_interval{perf_alloc(PC_INTERVAL, "ADIS16448: read interval")};
perf_counter_t _perf_transfer{perf_counter_t(perf_alloc(PC_ELAPSED, "ADIS16448: transfer"))};
perf_counter_t _perf_bad_transfer{perf_counter_t(perf_alloc(PC_COUNT, "ADIS16448: bad transfers"))};
perf_counter_t _perf_crc_bad{perf_counter_t(perf_alloc(PC_COUNT, "ADIS16448: CRC16 bad"))};
+1 -5
View File
@@ -55,10 +55,9 @@ using namespace time_literals;
ADIS16477::ADIS16477(int bus, uint32_t device, enum Rotation rotation) :
SPI("ADIS16477", nullptr, bus, device, SPIDEV_MODE3, 1000000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_px4_accel(get_device_id(), ORB_PRIO_MAX, rotation),
_px4_gyro(get_device_id(), ORB_PRIO_MAX, rotation),
_sample_interval_perf(perf_alloc(PC_INTERVAL, "adis16477: read interval")),
_sample_perf(perf_alloc(PC_ELAPSED, "adis16477: read")),
_bad_transfers(perf_alloc(PC_COUNT, "adis16477: bad transfers"))
{
@@ -82,7 +81,6 @@ ADIS16477::~ADIS16477()
stop();
// delete the perf counters
perf_free(_sample_interval_perf);
perf_free(_sample_perf);
perf_free(_bad_transfers);
}
@@ -321,7 +319,6 @@ ADIS16477::Run()
int
ADIS16477::measure()
{
perf_count(_sample_interval_perf);
perf_begin(_sample_perf);
// Fetch the full set of measurements from the ADIS16477 in one pass (burst read).
@@ -391,7 +388,6 @@ ADIS16477::measure()
void
ADIS16477::print_info()
{
perf_print_counter(_sample_interval_perf);
perf_print_counter(_sample_perf);
perf_print_counter(_bad_transfers);
-1
View File
@@ -65,7 +65,6 @@ private:
PX4Accelerometer _px4_accel;
PX4Gyroscope _px4_gyro;
perf_counter_t _sample_interval_perf;
perf_counter_t _sample_perf;
perf_counter_t _bad_transfers;
+1 -5
View File
@@ -68,10 +68,9 @@ using namespace time_literals;
ADIS16497::ADIS16497(int bus, uint32_t device, enum Rotation rotation) :
SPI("ADIS16497", nullptr, bus, device, SPIDEV_MODE3, 5000000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_px4_accel(get_device_id(), ORB_PRIO_MAX, rotation),
_px4_gyro(get_device_id(), ORB_PRIO_MAX, rotation),
_sample_interval_perf(perf_alloc(PC_INTERVAL, "adis16497: read interval")),
_sample_perf(perf_alloc(PC_ELAPSED, "adis16497: read")),
_bad_transfers(perf_alloc(PC_COUNT, "adis16497: bad transfers"))
{
@@ -95,7 +94,6 @@ ADIS16497::~ADIS16497()
stop();
// delete the perf counters
perf_free(_sample_interval_perf);
perf_free(_sample_perf);
perf_free(_bad_transfers);
}
@@ -384,7 +382,6 @@ ADIS16497::Run()
int
ADIS16497::measure()
{
perf_count(_sample_interval_perf);
perf_begin(_sample_perf);
// Fetch the full set of measurements from the ADIS16497 in one pass (burst read).
@@ -468,7 +465,6 @@ ADIS16497::measure()
void
ADIS16497::print_info()
{
perf_print_counter(_sample_interval_perf);
perf_print_counter(_sample_perf);
perf_print_counter(_bad_transfers);
-1
View File
@@ -101,7 +101,6 @@ private:
PX4Accelerometer _px4_accel;
PX4Gyroscope _px4_gyro;
perf_counter_t _sample_interval_perf;
perf_counter_t _sample_perf;
perf_counter_t _bad_transfers;
+1 -1
View File
@@ -223,7 +223,7 @@ private:
BMA180::BMA180(int bus, uint32_t device) :
SPI("BMA180", ACCEL_DEVICE_PATH, bus, device, SPIDEV_MODE3, 8000000),
ScheduledWorkItem(px4::device_bus_to_wq(this->get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(this->get_device_id())),
_call_interval(0),
_reports(nullptr),
_accel_range_scale(0.0f),
+1 -6
View File
@@ -46,10 +46,9 @@ const uint8_t BMI055_accel::_checked_registers[BMI055_ACCEL_NUM_CHECKED_REGISTER
BMI055_accel::BMI055_accel(int bus, const char *path_accel, uint32_t device, enum Rotation rotation) :
BMI055("BMI055_ACCEL", path_accel, bus, device, SPIDEV_MODE3, BMI055_BUS_SPEED, rotation),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_px4_accel(get_device_id(), (external() ? ORB_PRIO_MAX - 1 : ORB_PRIO_HIGH - 1), rotation),
_sample_perf(perf_alloc(PC_ELAPSED, "bmi055_accel_read")),
_measure_interval(perf_alloc(PC_INTERVAL, "bmi055_accel_measure_interval")),
_bad_transfers(perf_alloc(PC_COUNT, "bmi055_accel_bad_transfers")),
_bad_registers(perf_alloc(PC_COUNT, "bmi055_accel_bad_registers")),
_duplicates(perf_alloc(PC_COUNT, "bmi055_accel_duplicates")),
@@ -65,7 +64,6 @@ BMI055_accel::~BMI055_accel()
/* delete the perf counter */
perf_free(_sample_perf);
perf_free(_measure_interval);
perf_free(_bad_transfers);
perf_free(_bad_registers);
perf_free(_duplicates);
@@ -286,8 +284,6 @@ BMI055_accel::check_registers(void)
void
BMI055_accel::measure()
{
perf_count(_measure_interval);
if (hrt_absolute_time() < _reset_wait) {
// we're waiting for a reset to complete
return;
@@ -409,7 +405,6 @@ void
BMI055_accel::print_info()
{
perf_print_counter(_sample_perf);
perf_print_counter(_measure_interval);
perf_print_counter(_bad_transfers);
perf_print_counter(_bad_registers);
perf_print_counter(_duplicates);
-1
View File
@@ -169,7 +169,6 @@ private:
PX4Accelerometer _px4_accel;
perf_counter_t _sample_perf;
perf_counter_t _measure_interval;
perf_counter_t _bad_transfers;
perf_counter_t _bad_registers;
perf_counter_t _duplicates;
+1 -6
View File
@@ -49,10 +49,9 @@ const uint8_t BMI055_gyro::_checked_registers[BMI055_GYRO_NUM_CHECKED_REGISTERS]
BMI055_gyro::BMI055_gyro(int bus, const char *path_gyro, uint32_t device, enum Rotation rotation) :
BMI055("BMI055_GYRO", path_gyro, bus, device, SPIDEV_MODE3, BMI055_BUS_SPEED, rotation),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_px4_gyro(get_device_id(), (external() ? ORB_PRIO_MAX - 1 : ORB_PRIO_HIGH - 1), rotation),
_sample_perf(perf_alloc(PC_ELAPSED, "bmi055_gyro_read")),
_measure_interval(perf_alloc(PC_INTERVAL, "bmi055_gyro_measure_interval")),
_bad_transfers(perf_alloc(PC_COUNT, "bmi055_gyro_bad_transfers")),
_bad_registers(perf_alloc(PC_COUNT, "bmi055_gyro_bad_registers"))
{
@@ -66,7 +65,6 @@ BMI055_gyro::~BMI055_gyro()
/* delete the perf counter */
perf_free(_sample_perf);
perf_free(_measure_interval);
perf_free(_bad_transfers);
perf_free(_bad_registers);
}
@@ -322,8 +320,6 @@ BMI055_gyro::check_registers(void)
void
BMI055_gyro::measure()
{
perf_count(_measure_interval);
if (hrt_absolute_time() < _reset_wait) {
// we're waiting for a reset to complete
return;
@@ -421,7 +417,6 @@ BMI055_gyro::print_info()
PX4_INFO("Gyro");
perf_print_counter(_sample_perf);
perf_print_counter(_measure_interval);
perf_print_counter(_bad_transfers);
perf_print_counter(_bad_registers);
-1
View File
@@ -161,7 +161,6 @@ private:
PX4Gyroscope _px4_gyro;
perf_counter_t _sample_perf;
perf_counter_t _measure_interval;
perf_counter_t _bad_transfers;
perf_counter_t _bad_registers;
+1 -6
View File
@@ -54,10 +54,9 @@ const uint8_t BMI088_accel::_checked_registers[BMI088_ACCEL_NUM_CHECKED_REGISTER
BMI088_accel::BMI088_accel(int bus, const char *path_accel, uint32_t device, enum Rotation rotation) :
BMI088("BMI088_ACCEL", path_accel, bus, device, SPIDEV_MODE3, BMI088_BUS_SPEED, rotation),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_px4_accel(get_device_id(), (external() ? ORB_PRIO_MAX - 1 : ORB_PRIO_HIGH - 1), rotation),
_sample_perf(perf_alloc(PC_ELAPSED, "bmi088_accel_read")),
_measure_interval(perf_alloc(PC_INTERVAL, "bmi088_accel_measure_interval")),
_bad_transfers(perf_alloc(PC_COUNT, "bmi088_accel_bad_transfers")),
_bad_registers(perf_alloc(PC_COUNT, "bmi088_accel_bad_registers")),
_duplicates(perf_alloc(PC_COUNT, "bmi088_accel_duplicates")),
@@ -73,7 +72,6 @@ BMI088_accel::~BMI088_accel()
/* delete the perf counter */
perf_free(_sample_perf);
perf_free(_measure_interval);
perf_free(_bad_transfers);
perf_free(_bad_registers);
perf_free(_duplicates);
@@ -398,8 +396,6 @@ BMI088_accel::check_registers(void)
void
BMI088_accel::measure()
{
perf_count(_measure_interval);
if (hrt_absolute_time() < _reset_wait) {
// we're waiting for a reset to complete
return;
@@ -539,7 +535,6 @@ BMI088_accel::print_info()
PX4_INFO("Accel");
perf_print_counter(_sample_perf);
perf_print_counter(_measure_interval);
perf_print_counter(_bad_transfers);
perf_print_counter(_bad_registers);
perf_print_counter(_duplicates);
-1
View File
@@ -190,7 +190,6 @@ private:
PX4Accelerometer _px4_accel;
perf_counter_t _sample_perf;
perf_counter_t _measure_interval;
perf_counter_t _bad_transfers;
perf_counter_t _bad_registers;
perf_counter_t _duplicates;
+1 -6
View File
@@ -57,10 +57,9 @@ const uint8_t BMI088_gyro::_checked_registers[BMI088_GYRO_NUM_CHECKED_REGISTERS]
BMI088_gyro::BMI088_gyro(int bus, const char *path_gyro, uint32_t device, enum Rotation rotation) :
BMI088("BMI088_GYRO", path_gyro, bus, device, SPIDEV_MODE3, BMI088_BUS_SPEED, rotation),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_px4_gyro(get_device_id(), (external() ? ORB_PRIO_MAX - 1 : ORB_PRIO_HIGH - 1), rotation),
_sample_perf(perf_alloc(PC_ELAPSED, "bmi088_gyro_read")),
_measure_interval(perf_alloc(PC_INTERVAL, "bmi088_gyro_measure_interval")),
_bad_transfers(perf_alloc(PC_COUNT, "bmi088_gyro_bad_transfers")),
_bad_registers(perf_alloc(PC_COUNT, "bmi088_gyro_bad_registers"))
{
@@ -74,7 +73,6 @@ BMI088_gyro::~BMI088_gyro()
/* delete the perf counter */
perf_free(_sample_perf);
perf_free(_measure_interval);
perf_free(_bad_transfers);
perf_free(_bad_registers);
}
@@ -340,8 +338,6 @@ BMI088_gyro::check_registers(void)
void
BMI088_gyro::measure()
{
perf_count(_measure_interval);
if (hrt_absolute_time() < _reset_wait) {
// we're waiting for a reset to complete
return;
@@ -435,7 +431,6 @@ BMI088_gyro::print_info()
PX4_INFO("Gyro");
perf_print_counter(_sample_perf);
perf_print_counter(_measure_interval);
perf_print_counter(_bad_transfers);
perf_print_counter(_bad_registers);
-1
View File
@@ -159,7 +159,6 @@ private:
PX4Gyroscope _px4_gyro;
perf_counter_t _sample_perf;
perf_counter_t _measure_interval;
perf_counter_t _bad_transfers;
perf_counter_t _bad_registers;
+1 -1
View File
@@ -51,7 +51,7 @@ const uint8_t BMI160::_checked_registers[BMI160_NUM_CHECKED_REGISTERS] = { BM
BMI160::BMI160(int bus, uint32_t device, enum Rotation rotation) :
SPI("BMI160", nullptr, bus, device, SPIDEV_MODE3, BMI160_BUS_SPEED),
ScheduledWorkItem(px4::device_bus_to_wq(this->get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(this->get_device_id())),
_px4_accel(get_device_id(), (external() ? ORB_PRIO_MAX - 1 : ORB_PRIO_HIGH - 1), rotation),
_px4_gyro(get_device_id(), (external() ? ORB_PRIO_MAX - 1 : ORB_PRIO_HIGH - 1), rotation),
_accel_reads(perf_alloc(PC_COUNT, "bmi160_accel_read")),
+1 -5
View File
@@ -188,10 +188,9 @@ using namespace time_literals;
FXAS21002C::FXAS21002C(int bus, uint32_t device, enum Rotation rotation) :
SPI("FXAS21002C", nullptr, bus, device, SPIDEV_MODE0, 2 * 1000 * 1000),
ScheduledWorkItem(px4::device_bus_to_wq(this->get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(this->get_device_id())),
_px4_gyro(get_device_id(), (external() ? ORB_PRIO_VERY_HIGH : ORB_PRIO_DEFAULT), rotation),
_sample_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": read")),
_sample_interval_perf(perf_alloc(PC_INTERVAL, MODULE_NAME": read interval")),
_errors(perf_alloc(PC_COUNT, MODULE_NAME": err")),
_bad_registers(perf_alloc(PC_COUNT, MODULE_NAME": bad register")),
_duplicates(perf_alloc(PC_COUNT, MODULE_NAME": duplicate reading"))
@@ -206,7 +205,6 @@ FXAS21002C::~FXAS21002C()
/* delete the perf counter */
perf_free(_sample_perf);
perf_free(_sample_interval_perf);
perf_free(_errors);
perf_free(_bad_registers);
perf_free(_duplicates);
@@ -530,7 +528,6 @@ FXAS21002C::measure()
{
// start the performance counter
perf_begin(_sample_perf);
perf_count(_sample_interval_perf);
/* status register and data as read back from the device */
#pragma pack(push, 1)
@@ -598,7 +595,6 @@ FXAS21002C::print_info()
{
printf("gyro reads: %u\n", _read);
perf_print_counter(_sample_perf);
perf_print_counter(_sample_interval_perf);
perf_print_counter(_errors);
perf_print_counter(_bad_registers);
perf_print_counter(_duplicates);
@@ -81,7 +81,6 @@ private:
unsigned _read{0};
perf_counter_t _sample_perf;
perf_counter_t _sample_interval_perf;
perf_counter_t _errors;
perf_counter_t _bad_registers;
perf_counter_t _duplicates;
+1 -5
View File
@@ -55,14 +55,13 @@ const uint8_t FXOS8701CQ::_checked_registers[FXOS8701C_NUM_CHECKED_REGISTERS] =
FXOS8701CQ::FXOS8701CQ(int bus, uint32_t device, enum Rotation rotation) :
SPI("FXOS8701CQ", nullptr, bus, device, SPIDEV_MODE0, 1 * 1000 * 1000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_px4_accel(get_device_id(), ORB_PRIO_LOW, rotation),
#if !defined(BOARD_HAS_NOISY_FXOS8700_MAG)
_px4_mag(get_device_id(), ORB_PRIO_LOW, rotation),
_mag_sample_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": mag read")),
#endif
_accel_sample_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": acc read")),
_accel_sample_interval_perf(perf_alloc(PC_INTERVAL, MODULE_NAME": acc read interval")),
_bad_registers(perf_alloc(PC_COUNT, MODULE_NAME": bad reg")),
_accel_duplicates(perf_alloc(PC_COUNT, MODULE_NAME": acc dupe"))
{
@@ -87,7 +86,6 @@ FXOS8701CQ::~FXOS8701CQ()
// delete the perf counter
perf_free(_accel_sample_perf);
perf_free(_accel_sample_interval_perf);
perf_free(_bad_registers);
perf_free(_accel_duplicates);
}
@@ -334,7 +332,6 @@ FXOS8701CQ::Run()
{
// start the performance counter
perf_begin(_accel_sample_perf);
perf_count(_accel_sample_interval_perf);
// status register and data as read back from the device
#pragma pack(push, 1)
@@ -413,7 +410,6 @@ void
FXOS8701CQ::print_info()
{
perf_print_counter(_accel_sample_perf);
perf_print_counter(_accel_sample_interval_perf);
#if !defined(BOARD_HAS_NOISY_FXOS8700_MAG)
perf_print_counter(_mag_sample_perf);
@@ -214,7 +214,6 @@ private:
unsigned _accel_samplerate{FXOS8701C_ACCEL_DEFAULT_RATE};
perf_counter_t _accel_sample_perf;
perf_counter_t _accel_sample_interval_perf;
perf_counter_t _bad_registers;
perf_counter_t _accel_duplicates;
+1 -1
View File
@@ -86,7 +86,7 @@ const uint16_t ICM20948::_icm20948_checked_registers[ICM20948_NUM_CHECKED_REGIST
ICM20948::ICM20948(device::Device *interface, device::Device *mag_interface, const char *path, enum Rotation rotation,
bool magnetometer_only) :
ScheduledWorkItem(px4::device_bus_to_wq(interface->get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(interface->get_device_id())),
_interface(interface),
_px4_accel(_interface->get_device_id(), (_interface->external() ? ORB_PRIO_DEFAULT : ORB_PRIO_HIGH), rotation),
_px4_gyro(_interface->get_device_id(), (_interface->external() ? ORB_PRIO_DEFAULT : ORB_PRIO_HIGH), rotation),
+1 -1
View File
@@ -322,7 +322,7 @@ constexpr uint8_t L3GD20::_checked_registers[];
L3GD20::L3GD20(int bus, const char *path, uint32_t device, enum Rotation rotation) :
SPI("L3GD20", path, bus, device, SPIDEV_MODE3, 11 * 1000 * 1000),
ScheduledWorkItem(px4::device_bus_to_wq(this->get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(this->get_device_id())),
_px4_gyro(get_device_id(), ORB_PRIO_DEFAULT, rotation),
_sample_perf(perf_alloc(PC_ELAPSED, "l3gd20_read")),
_errors(perf_alloc(PC_COUNT, "l3gd20_err")),
+1 -9
View File
@@ -55,13 +55,11 @@ static constexpr uint8_t _checked_registers[] = {
LSM303D::LSM303D(int bus, uint32_t device, enum Rotation rotation) :
SPI("LSM303D", nullptr, bus, device, SPIDEV_MODE3, 11 * 1000 * 1000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_px4_accel(get_device_id(), ORB_PRIO_DEFAULT, rotation),
_px4_mag(get_device_id(), ORB_PRIO_LOW, rotation),
_accel_sample_perf(perf_alloc(PC_ELAPSED, "lsm303d: acc_read")),
_accel_sample_interval_perf(perf_alloc(PC_INTERVAL, "lsm303d: acc interval")),
_mag_sample_perf(perf_alloc(PC_ELAPSED, "lsm303d: mag_read")),
_mag_sample_interval_perf(perf_alloc(PC_INTERVAL, "lsm303d: mag interval")),
_bad_registers(perf_alloc(PC_COUNT, "lsm303d: bad_reg")),
_bad_values(perf_alloc(PC_COUNT, "lsm303d: bad_val")),
_accel_duplicates(perf_alloc(PC_COUNT, "lsm303d: acc_dupe"))
@@ -78,9 +76,7 @@ LSM303D::~LSM303D()
// delete the perf counter
perf_free(_accel_sample_perf);
perf_free(_accel_sample_interval_perf);
perf_free(_mag_sample_perf);
perf_free(_mag_sample_interval_perf);
perf_free(_bad_registers);
perf_free(_bad_values);
perf_free(_accel_duplicates);
@@ -470,7 +466,6 @@ void
LSM303D::measureAccelerometer()
{
perf_begin(_accel_sample_perf);
perf_count(_accel_sample_interval_perf);
// status register and data as read back from the device
#pragma pack(push, 1)
@@ -552,7 +547,6 @@ void
LSM303D::measureMagnetometer()
{
perf_begin(_mag_sample_perf);
perf_count(_mag_sample_interval_perf);
// status register and data as read back from the device
#pragma pack(push, 1)
@@ -591,9 +585,7 @@ void
LSM303D::print_info()
{
perf_print_counter(_accel_sample_perf);
perf_print_counter(_accel_sample_interval_perf);
perf_print_counter(_mag_sample_perf);
perf_print_counter(_mag_sample_interval_perf);
perf_print_counter(_bad_registers);
perf_print_counter(_bad_values);
perf_print_counter(_accel_duplicates);
-2
View File
@@ -274,9 +274,7 @@ private:
unsigned _call_mag_interval{1000000 / LSM303D_MAG_DEFAULT_RATE};
perf_counter_t _accel_sample_perf;
perf_counter_t _accel_sample_interval_perf;
perf_counter_t _mag_sample_perf;
perf_counter_t _mag_sample_interval_perf;
perf_counter_t _bad_registers;
perf_counter_t _bad_values;
perf_counter_t _accel_duplicates;
+1 -6
View File
@@ -41,13 +41,12 @@ constexpr uint8_t MPU6000::_checked_registers[MPU6000_NUM_CHECKED_REGISTERS];
MPU6000::MPU6000(device::Device *interface, const char *path, enum Rotation rotation, int device_type) :
CDev(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),
_device_type(device_type),
_px4_accel(_interface->get_device_id(), (_interface->external() ? ORB_PRIO_MAX : ORB_PRIO_HIGH), rotation),
_px4_gyro(_interface->get_device_id(), (_interface->external() ? ORB_PRIO_MAX : ORB_PRIO_HIGH), rotation),
_sample_perf(perf_alloc(PC_ELAPSED, "mpu6k_read")),
_measure_interval(perf_alloc(PC_INTERVAL, "mpu6k_measure_interval")),
_bad_transfers(perf_alloc(PC_COUNT, "mpu6k_bad_trans")),
_bad_registers(perf_alloc(PC_COUNT, "mpu6k_bad_reg")),
_reset_retries(perf_alloc(PC_COUNT, "mpu6k_reset")),
@@ -84,7 +83,6 @@ MPU6000::~MPU6000()
/* delete the perf counter */
perf_free(_sample_perf);
perf_free(_measure_interval);
perf_free(_bad_transfers);
perf_free(_bad_registers);
perf_free(_reset_retries);
@@ -729,8 +727,6 @@ MPU6000::check_registers(void)
int
MPU6000::measure()
{
perf_count(_measure_interval);
if (_in_factory_test) {
// don't publish any data while in factory test mode
return OK;
@@ -897,7 +893,6 @@ void
MPU6000::print_info()
{
perf_print_counter(_sample_perf);
perf_print_counter(_measure_interval);
perf_print_counter(_bad_transfers);
perf_print_counter(_bad_registers);
perf_print_counter(_reset_retries);
-1
View File
@@ -358,7 +358,6 @@ private:
unsigned _sample_rate{1000};
perf_counter_t _sample_perf;
perf_counter_t _measure_interval;
perf_counter_t _bad_transfers;
perf_counter_t _bad_registers;
perf_counter_t _reset_retries;
+1 -1
View File
@@ -72,7 +72,7 @@ const uint16_t MPU9250::_mpu9250_checked_registers[MPU9250_NUM_CHECKED_REGISTERS
MPU9250::MPU9250(device::Device *interface, device::Device *mag_interface, const char *path, enum Rotation rotation,
bool magnetometer_only) :
ScheduledWorkItem(px4::device_bus_to_wq(interface->get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(interface->get_device_id())),
_interface(interface),
_px4_accel(_interface->get_device_id(), (_interface->external() ? ORB_PRIO_MAX : ORB_PRIO_HIGH), rotation),
_px4_gyro(_interface->get_device_id(), (_interface->external() ? ORB_PRIO_MAX : ORB_PRIO_HIGH), rotation),
+1 -1
View File
@@ -148,7 +148,7 @@ extern "C" __EXPORT int irlock_main(int argc, char *argv[]);
/** constructor **/
IRLOCK::IRLOCK(int bus, int address) :
I2C("irlock", IRLOCK0_DEVICE_PATH, bus, address, 400000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_reports(nullptr),
_sensor_ok(false),
_read_failures(0),
+1 -1
View File
@@ -256,7 +256,7 @@ extern "C" __EXPORT int blinkm_main(int argc, char *argv[]);
BlinkM::BlinkM(int bus, int blinkm) :
I2C("blinkm", BLINKM0_DEVICE_PATH, bus, blinkm, 100000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
led_color_1(LED_OFF),
led_color_2(LED_OFF),
led_color_3(LED_OFF),
+1 -1
View File
@@ -105,7 +105,7 @@ extern "C" __EXPORT int rgbled_main(int argc, char *argv[]);
RGBLED::RGBLED(int bus, int rgbled) :
I2C("rgbled", RGBLED0_DEVICE_PATH, bus, rgbled, 100000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id()))
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id()))
{
}
@@ -105,7 +105,7 @@ extern "C" __EXPORT int rgbled_ncp5623c_main(int argc, char *argv[]);
RGBLED_NPC5623C::RGBLED_NPC5623C(int bus, int rgbled) :
I2C("rgbled1", RGBLED1_DEVICE_PATH, bus, rgbled, 100000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id()))
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id()))
{
}
+1 -1
View File
@@ -88,7 +88,7 @@ RGBLED_PWM *g_rgbled = nullptr;
RGBLED_PWM::RGBLED_PWM() :
CDev("rgbled_pwm", RGBLED_PWM0_DEVICE_PATH),
ScheduledWorkItem(px4::wq_configurations::lp_default)
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::lp_default)
{
}
+1 -1
View File
@@ -70,7 +70,7 @@ class RcInput : public px4::ScheduledWorkItem
{
public:
RcInput() :
ScheduledWorkItem(px4::wq_configurations::hp_default),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default),
_shouldExit(false),
_isRunning(false),
_rcinput_pub(nullptr),
+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{},
+1 -6
View File
@@ -35,9 +35,8 @@
PAW3902::PAW3902(int bus, enum Rotation yaw_rotation) :
SPI("PAW3902", nullptr, bus, PAW3902_SPIDEV, SPIDEV_MODE0, PAW3902_SPI_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, "paw3902: read")),
_interval_perf(perf_alloc(PC_INTERVAL, "paw3902: interval")),
_comms_errors(perf_alloc(PC_COUNT, "paw3902: com_err")),
_dupe_count_perf(perf_alloc(PC_COUNT, "paw3902: duplicate reading")),
_yaw_rotation(yaw_rotation)
@@ -51,12 +50,10 @@ PAW3902::~PAW3902()
// free perf counters
perf_free(_sample_perf);
perf_free(_interval_perf);
perf_free(_comms_errors);
perf_free(_dupe_count_perf);
}
int
PAW3902::init()
{
@@ -540,7 +537,6 @@ void
PAW3902::Run()
{
perf_begin(_sample_perf);
perf_count(_interval_perf);
struct TransferBuffer {
uint8_t cmd = Register::Motion_Burst;
@@ -699,7 +695,6 @@ void
PAW3902::print_info()
{
perf_print_counter(_sample_perf);
perf_print_counter(_interval_perf);
perf_print_counter(_comms_errors);
perf_print_counter(_dupe_count_perf);
}
@@ -120,7 +120,6 @@ private:
uORB::PublicationMulti<optical_flow_s> _optical_flow_pub{ORB_ID(optical_flow)};
perf_counter_t _sample_perf;
perf_counter_t _interval_perf;
perf_counter_t _comms_errors;
perf_counter_t _dupe_count_perf;
+1 -1
View File
@@ -37,7 +37,7 @@ static constexpr uint32_t TIME_us_TSWW = 11; // - actually 10.5us
PMW3901::PMW3901(int bus, enum Rotation yaw_rotation) :
SPI("PMW3901", PMW3901_DEVICE_PATH, bus, PMW3901_SPIDEV, SPIDEV_MODE0, PMW3901_SPI_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, "pmw3901: read")),
_comms_errors(perf_alloc(PC_COUNT, "pmw3901: com err")),
_yaw_rotation(yaw_rotation)
+1 -1
View File
@@ -153,7 +153,7 @@ extern "C" __EXPORT int px4flow_main(int argc, char *argv[]);
PX4FLOW::PX4FLOW(int bus, int address, enum Rotation rotation, int conversion_interval, uint8_t sonar_rotation) :
I2C("PX4FLOW", PX4FLOW0_DEVICE_PATH, bus, address, PX4FLOW_I2C_MAX_BUS_SPEED), /* 100-400 KHz */
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_sonar_rotation(sonar_rotation),
_sample_perf(perf_alloc(PC_ELAPSED, "px4f_read")),
_comms_errors(perf_alloc(PC_COUNT, "px4f_com_err")),
+1 -1
View File
@@ -49,7 +49,7 @@ static constexpr uint32_t OSD_UPDATE_RATE{500_ms}; // 2 Hz
OSDatxxxx::OSDatxxxx(int bus) :
SPI("OSD", nullptr, bus, PX4_MK_SPI_SEL(bus, OSD_SPIDEV), SPIDEV_MODE0, OSD_SPI_BUS_SPEED),
ModuleParams(nullptr),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id()))
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id()))
{
}
+1 -1
View File
@@ -184,7 +184,7 @@ extern "C" __EXPORT int pca9685_main(int argc, char *argv[]);
PCA9685::PCA9685(int bus, uint8_t address) :
I2C("pca9685", PCA9685_DEVICE_PATH, bus, address, 100000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_mode(IOX_MODE_OFF),
_running(false),
_i2cpwm_interval(1_s / 60.0f),
+1 -1
View File
@@ -222,7 +222,7 @@ extern "C" __EXPORT int ina226_main(int argc, char *argv[]);
INA226::INA226(int bus, int address) :
I2C("INA226", nullptr, bus, address, 100000),
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, "ina226_read")),
_comms_errors(perf_alloc(PC_COUNT, "ina226_com_err"))
{
+1 -2
View File
@@ -57,7 +57,6 @@
#include <px4_getopt.h>
#include <px4_log.h>
#include <px4_module.h>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
#include <uORB/Publication.hpp>
#include <uORB/PublicationMulti.hpp>
#include <uORB/Subscription.hpp>
@@ -215,7 +214,7 @@ private:
PX4FMU::PX4FMU() :
CDev(PX4FMU_DEVICE_PATH),
OutputModuleInterface(px4::wq_configurations::hp_default),
OutputModuleInterface(MODULE_NAME, px4::wq_configurations::hp_default),
_cycle_perf(perf_alloc(PC_ELAPSED, "px4fmu: cycle")),
_cycle_interval_perf(perf_alloc(PC_INTERVAL, "px4fmu: cycle interval"))
{
+2 -2
View File
@@ -45,8 +45,8 @@ work_s RCInput::_work = {};
constexpr char const *RCInput::RC_SCAN_STRING[];
RCInput::RCInput(bool run_as_task, char *device) :
_cycle_perf(perf_alloc(PC_ELAPSED, "rc_input cycle time")),
_publish_interval_perf(perf_alloc(PC_INTERVAL, "rc_input publish interval"))
_cycle_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle time")),
_publish_interval_perf(perf_alloc(PC_INTERVAL, MODULE_NAME": publish interval"))
{
// rc input, published to ORB
_rc_in.input_source = input_rc_s::RC_INPUT_SOURCE_PX4FMU_PPM;
+1 -1
View File
@@ -64,7 +64,7 @@ namespace rpi_rc_in
class RcInput : public px4::ScheduledWorkItem
{
public:
RcInput() : ScheduledWorkItem(px4::wq_configurations::hp_default) {}
RcInput() : ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default) {}
~RcInput();
+1 -1
View File
@@ -50,7 +50,7 @@
class SafetyButton : public ModuleBase<SafetyButton>, public px4::ScheduledWorkItem
{
public:
SafetyButton() : ScheduledWorkItem(px4::wq_configurations::hp_default) {}
SafetyButton() : ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default) {}
virtual ~SafetyButton();
/** @see ModuleBase */
+1 -1
View File
@@ -191,7 +191,7 @@ static BST *g_bst = nullptr;
BST::BST(int bus) :
I2C("bst", nullptr, bus, BST_ADDR, 100000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id()))
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id()))
{
}
+1 -1
View File
@@ -41,7 +41,7 @@
ToneAlarm::ToneAlarm() :
CDev(TONE_ALARM0_DEVICE_PATH),
ScheduledWorkItem(px4::wq_configurations::hp_default)
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default)
{
}
+1 -1
View File
@@ -58,7 +58,7 @@
Airspeed::Airspeed(int bus, int address, unsigned conversion_interval, const char *path) :
I2C("Airspeed", path, bus, address, 100000),
ScheduledWorkItem(px4::device_bus_to_wq(get_device_id())),
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_sensor_ok(false),
_measure_interval(0),
_collect_phase(false),
-1
View File
@@ -32,4 +32,3 @@
############################################################################
px4_add_library(mixer_module mixer_module.cpp)
-1
View File
@@ -524,4 +524,3 @@ int MixingOutput::loadMixerThreadSafe(const char *buf, unsigned len)
return _command.result;
}
+2 -3
View File
@@ -61,8 +61,8 @@ class OutputModuleInterface : public px4::ScheduledWorkItem, public ModuleParams
public:
static constexpr int MAX_ACTUATORS = DIRECT_PWM_OUTPUT_CHANNELS;
OutputModuleInterface(const px4::wq_config_t &config)
: px4::ScheduledWorkItem(config), ModuleParams(nullptr) {}
OutputModuleInterface(const char *name, const px4::wq_config_t &config)
: px4::ScheduledWorkItem(name, config), ModuleParams(nullptr) {}
virtual void updateOutputs(bool stop_motors, uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) = 0;
@@ -239,4 +239,3 @@ private:
)
};
-1
View File
@@ -77,4 +77,3 @@ __EXPORT void output_limit_calc(const bool armed, const bool pre_armed, const un
const float *output, uint16_t *effective_output, output_limit_t *limit);
__END_DECLS
@@ -137,8 +137,6 @@ private:
bool _scale_estimation_previously_on{false}; /**< scale_estimation was on in the last cycle */
perf_counter_t _perf_elapsed{};
perf_counter_t _perf_interval{};
DEFINE_PARAMETERS(
(ParamFloat<px4::params::ARSP_W_P_NOISE>) _param_west_w_p_noise,
@@ -170,13 +168,12 @@ private:
AirspeedModule::AirspeedModule():
ModuleParams(nullptr),
ScheduledWorkItem(px4::wq_configurations::lp_default)
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::lp_default)
{
// initialise parameters
update_params();
_perf_elapsed = perf_alloc_once(PC_ELAPSED, "airspeed_selector elapsed");
_perf_interval = perf_alloc_once(PC_INTERVAL, "airspeed_selector interval");
}
AirspeedModule::~AirspeedModule()
@@ -184,7 +181,6 @@ AirspeedModule::~AirspeedModule()
ScheduleClear();
perf_free(_perf_elapsed);
perf_free(_perf_interval);
if (_airspeed_validator != nullptr) {
delete[] _airspeed_validator;
@@ -216,7 +212,6 @@ AirspeedModule::task_spawn(int argc, char *argv[])
void
AirspeedModule::Run()
{
perf_count(_perf_interval);
perf_begin(_perf_elapsed);
/* the first time we run through here, initialize N airspeedValidator
@@ -572,7 +567,6 @@ and also publishes those.
int AirspeedModule::print_status()
{
perf_print_counter(_perf_elapsed);
perf_print_counter(_perf_interval);
int instance = 0;
uORB::SubscriptionData<airspeed_validated_s> est{ORB_ID(airspeed_validated), (uint8_t)instance};
@@ -45,9 +45,8 @@ using namespace time_literals;
extern "C" __EXPORT int fw_att_control_main(int argc, char *argv[]);
FixedwingAttitudeControl::FixedwingAttitudeControl() :
WorkItem(px4::wq_configurations::att_pos_ctrl),
_loop_perf(perf_alloc(PC_ELAPSED, "fw_att_control: cycle")),
_loop_interval_perf(perf_alloc(PC_INTERVAL, "fw_att_control: interval"))
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl),
_loop_perf(perf_alloc(PC_ELAPSED, "fw_att_control: cycle"))
{
// check if VTOL first
vehicle_status_poll();
@@ -132,7 +131,6 @@ FixedwingAttitudeControl::FixedwingAttitudeControl() :
FixedwingAttitudeControl::~FixedwingAttitudeControl()
{
perf_free(_loop_perf);
perf_free(_loop_interval_perf);
}
bool
@@ -450,7 +448,6 @@ void FixedwingAttitudeControl::Run()
}
perf_begin(_loop_perf);
perf_count(_loop_interval_perf);
if (_att_sub.update(&_att)) {
@@ -922,7 +919,6 @@ int FixedwingAttitudeControl::print_status()
PX4_INFO("Running");
perf_print_counter(_loop_perf);
perf_print_counter(_loop_interval_perf);
return 0;
}
@@ -131,7 +131,6 @@ private:
vehicle_status_s _vehicle_status {}; /**< vehicle status */
perf_counter_t _loop_perf; /**< loop performance counter */
perf_counter_t _loop_interval_perf; /**< loop interval performance counter */
float _flaps_applied{0.0f};
float _flaperons_applied{0.0f};
@@ -37,9 +37,8 @@ extern "C" __EXPORT int fw_pos_control_l1_main(int argc, char *argv[]);
FixedwingPositionControl::FixedwingPositionControl() :
ModuleParams(nullptr),
WorkItem(px4::wq_configurations::att_pos_ctrl),
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl),
_loop_perf(perf_alloc(PC_ELAPSED, "fw_pos_control_l1: cycle")),
_loop_interval_perf(perf_alloc(PC_INTERVAL, "fw_pos_control_l1: interval")),
_launchDetector(this),
_runway_takeoff(this)
{
@@ -114,7 +113,6 @@ FixedwingPositionControl::FixedwingPositionControl() :
FixedwingPositionControl::~FixedwingPositionControl()
{
perf_free(_loop_perf);
perf_free(_loop_interval_perf);
}
bool
@@ -1657,7 +1655,6 @@ FixedwingPositionControl::Run()
}
perf_begin(_loop_perf);
perf_count(_loop_interval_perf);
/* only run controller if position changed */
if (_global_pos_sub.update(&_global_pos)) {
@@ -1990,7 +1987,6 @@ int FixedwingPositionControl::print_status()
PX4_INFO("Running");
perf_print_counter(_loop_perf);
perf_print_counter(_loop_interval_perf);
return 0;
}
@@ -187,7 +187,6 @@ private:
SubscriptionData<vehicle_acceleration_s> _vehicle_acceleration_sub{ORB_ID(vehicle_acceleration)};
perf_counter_t _loop_perf; ///< loop performance counter */
perf_counter_t _loop_interval_perf; ///< loop interval performance counter */
float _hold_alt{0.0f}; ///< hold altitude for altitude mode */
float _takeoff_ground_alt{0.0f}; ///< ground altitude at which plane was launched */
+1 -1
View File
@@ -55,7 +55,7 @@ namespace land_detector
LandDetector::LandDetector() :
ModuleParams(nullptr),
ScheduledWorkItem(px4::wq_configurations::hp_default)
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default)
{
_land_detected.timestamp = hrt_absolute_time();
_land_detected.freefall = false;
+1 -1
View File
@@ -123,7 +123,7 @@ private:
LoadMon::LoadMon() :
ModuleParams(nullptr),
ScheduledWorkItem(px4::wq_configurations::lp_default),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::lp_default),
_stack_perf(perf_alloc(PC_ELAPSED, "stack_check"))
{
}
@@ -63,7 +63,7 @@ using namespace matrix;
MulticopterAttitudeControl::MulticopterAttitudeControl() :
ModuleParams(nullptr),
WorkItem(px4::wq_configurations::rate_ctrl),
WorkItem(MODULE_NAME, px4::wq_configurations::rate_ctrl),
_loop_perf(perf_alloc(PC_ELAPSED, "mc_att_control"))
{
_vehicle_status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_ROTARY_WING;
+2 -2
View File
@@ -53,6 +53,6 @@ px4_add_module(
git_ecl
ecl_validation
mathlib
sensors__vehicle_acceleration
sensors__vehicle_angular_velocity
vehicle_acceleration
vehicle_angular_velocity
)
@@ -31,7 +31,7 @@
#
############################################################################
px4_add_library(sensors__vehicle_acceleration
px4_add_library(vehicle_acceleration
VehicleAcceleration.cpp
)
target_link_libraries(sensors__vehicle_acceleration PRIVATE px4_work_queue)
target_link_libraries(vehicle_acceleration PRIVATE px4_work_queue)
@@ -40,9 +40,8 @@ using namespace time_literals;
VehicleAcceleration::VehicleAcceleration() :
ModuleParams(nullptr),
WorkItem(px4::wq_configurations::att_pos_ctrl),
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl),
_cycle_perf(perf_alloc(PC_ELAPSED, "vehicle_acceleration: cycle time")),
_interval_perf(perf_alloc(PC_INTERVAL, "vehicle_acceleration: interval")),
_sensor_latency_perf(perf_alloc(PC_ELAPSED, "vehicle_acceleration: sensor latency"))
{
}
@@ -52,7 +51,6 @@ VehicleAcceleration::~VehicleAcceleration()
Stop();
perf_free(_cycle_perf);
perf_free(_interval_perf);
perf_free(_sensor_latency_perf);
}
@@ -178,7 +176,6 @@ void
VehicleAcceleration::Run()
{
perf_begin(_cycle_perf);
perf_count(_interval_perf);
// update corrections first to set _selected_sensor
SensorCorrectionsUpdate();
@@ -220,6 +217,5 @@ VehicleAcceleration::PrintStatus()
PX4_INFO("selected sensor: %d", _selected_sensor);
perf_print_counter(_cycle_perf);
perf_print_counter(_interval_perf);
perf_print_counter(_sensor_latency_perf);
}
@@ -102,7 +102,6 @@ private:
matrix::Vector3f _bias;
perf_counter_t _cycle_perf;
perf_counter_t _interval_perf;
perf_counter_t _sensor_latency_perf;
uint8_t _selected_sensor{0};
@@ -31,7 +31,7 @@
#
############################################################################
px4_add_library(sensors__vehicle_angular_velocity
px4_add_library(vehicle_angular_velocity
VehicleAngularVelocity.cpp
)
target_link_libraries(sensors__vehicle_angular_velocity PRIVATE px4_work_queue)
target_link_libraries(vehicle_angular_velocity PRIVATE px4_work_queue)
@@ -40,9 +40,8 @@ using namespace time_literals;
VehicleAngularVelocity::VehicleAngularVelocity() :
ModuleParams(nullptr),
WorkItem(px4::wq_configurations::rate_ctrl),
WorkItem(MODULE_NAME, px4::wq_configurations::rate_ctrl),
_cycle_perf(perf_alloc(PC_ELAPSED, "vehicle_angular_velocity: cycle time")),
_interval_perf(perf_alloc(PC_INTERVAL, "vehicle_angular_velocity: interval")),
_sensor_latency_perf(perf_alloc(PC_ELAPSED, "vehicle_angular_velocity: sensor latency"))
{
}
@@ -52,7 +51,6 @@ VehicleAngularVelocity::~VehicleAngularVelocity()
Stop();
perf_free(_cycle_perf);
perf_free(_interval_perf);
perf_free(_sensor_latency_perf);
}
@@ -217,7 +215,6 @@ void
VehicleAngularVelocity::Run()
{
perf_begin(_cycle_perf);
perf_count(_interval_perf);
// update corrections first to set _selected_sensor
SensorCorrectionsUpdate();
@@ -296,6 +293,5 @@ VehicleAngularVelocity::PrintStatus()
}
perf_print_counter(_cycle_perf);
perf_print_counter(_interval_perf);
perf_print_counter(_sensor_latency_perf);
}
@@ -110,7 +110,6 @@ private:
matrix::Vector3f _bias;
perf_counter_t _cycle_perf;
perf_counter_t _interval_perf;
perf_counter_t _sensor_latency_perf;
uint32_t _selected_sensor_device_id{0};
@@ -54,9 +54,8 @@
using namespace matrix;
VtolAttitudeControl::VtolAttitudeControl() :
WorkItem(px4::wq_configurations::rate_ctrl),
_loop_perf(perf_alloc(PC_ELAPSED, "vtol_att_control: cycle")),
_loop_interval_perf(perf_alloc(PC_INTERVAL, "vtol_att_control: interval"))
WorkItem(MODULE_NAME, px4::wq_configurations::rate_ctrl),
_loop_perf(perf_alloc(PC_ELAPSED, "vtol_att_control: cycle"))
{
_vtol_vehicle_status.vtol_in_rw_mode = true; /* start vtol in rotary wing mode*/
@@ -108,7 +107,6 @@ VtolAttitudeControl::VtolAttitudeControl() :
VtolAttitudeControl::~VtolAttitudeControl()
{
perf_free(_loop_perf);
perf_free(_loop_interval_perf);
}
bool
@@ -309,7 +307,6 @@ VtolAttitudeControl::Run()
}
perf_begin(_loop_perf);
perf_count(_loop_interval_perf);
const bool updated_fw_in = _actuator_inputs_fw.update(&_actuators_fw_in);
const bool updated_mc_in = _actuator_inputs_mc.update(&_actuators_mc_in);
@@ -513,7 +510,6 @@ VtolAttitudeControl::print_status()
PX4_INFO("Running");
perf_print_counter(_loop_perf);
perf_print_counter(_loop_interval_perf);
return PX4_OK;
}

Some files were not shown because too many files have changed in this diff Show More