mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 05:33:34 +08:00
delete lib/mixer and mixer_module static mixing
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
#include "modalai_esc.hpp"
|
||||
#include "modalai_esc_serial.hpp"
|
||||
|
||||
#define MODALAI_ESC_DEVICE_PATH "/dev/uart_esc"
|
||||
#define MODALAI_ESC_DEFAULT_PORT "/dev/ttyS1"
|
||||
#define MODALAI_ESC_VOXL_PORT "/dev/ttyS4"
|
||||
|
||||
@@ -48,7 +47,6 @@
|
||||
const char *_device;
|
||||
|
||||
ModalaiEsc::ModalaiEsc() :
|
||||
CDev(MODALAI_ESC_DEVICE_PATH),
|
||||
OutputModuleInterface(MODULE_NAME, px4::wq_configurations::hp_default),
|
||||
_cycle_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")),
|
||||
_output_update_perf(perf_alloc(PC_INTERVAL, MODULE_NAME": output update interval"))
|
||||
@@ -96,35 +94,15 @@ ModalaiEsc::~ModalaiEsc()
|
||||
_uart_port_bridge = nullptr;
|
||||
}
|
||||
|
||||
/* clean up the alternate device node */
|
||||
unregister_class_devname(PWM_OUTPUT_BASE_DEVICE_PATH, _class_instance);
|
||||
|
||||
perf_free(_cycle_perf);
|
||||
perf_free(_output_update_perf);
|
||||
}
|
||||
|
||||
int ModalaiEsc::init()
|
||||
{
|
||||
/* do regular cdev init */
|
||||
int ret = CDev::init();
|
||||
|
||||
if (ret != OK) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* try to claim the generic PWM output device node as well - it's OK if we fail at this */
|
||||
_class_instance = register_class_devname(MODALAI_ESC_DEVICE_PATH);
|
||||
|
||||
if (_class_instance == CLASS_DEVICE_PRIMARY) {
|
||||
/* lets not be too verbose */
|
||||
} else if (_class_instance < 0) {
|
||||
PX4_ERR("FAILED registering class device");
|
||||
}
|
||||
|
||||
_mixing_output.setDriverInstance(_class_instance);
|
||||
|
||||
/* Getting initial parameter values */
|
||||
ret = update_params();
|
||||
int ret = update_params();
|
||||
|
||||
if (ret != OK) {
|
||||
return ret;
|
||||
@@ -1135,8 +1113,6 @@ void ModalaiEsc::Run()
|
||||
return;
|
||||
}
|
||||
|
||||
SmartLock lock_guard(_lock);
|
||||
|
||||
perf_begin(_cycle_perf);
|
||||
|
||||
/* Open serial port in this thread */
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <drivers/device/device.h>
|
||||
#include <lib/cdev/CDev.hpp>
|
||||
#include <lib/led/led.h>
|
||||
#include <lib/mixer_module/mixer_module.hpp>
|
||||
#include <lib/perf/perf_counter.h>
|
||||
@@ -51,7 +50,7 @@
|
||||
#include "qc_esc_packet.h"
|
||||
#include "qc_esc_packet_types.h"
|
||||
|
||||
class ModalaiEsc : public cdev::CDev, public ModuleBase<ModalaiEsc>, public OutputModuleInterface
|
||||
class ModalaiEsc : public ModuleBase<ModalaiEsc>, public OutputModuleInterface
|
||||
{
|
||||
public:
|
||||
ModalaiEsc();
|
||||
@@ -76,9 +75,6 @@ public:
|
||||
bool updateOutputs(bool stop_motors, uint16_t outputs[MAX_ACTUATORS],
|
||||
unsigned num_outputs, unsigned num_control_groups_updated) override;
|
||||
|
||||
/** @see OutputModuleInterface */
|
||||
void mixerChanged() override;
|
||||
|
||||
virtual int init();
|
||||
|
||||
typedef enum {
|
||||
@@ -183,8 +179,6 @@ private:
|
||||
ch_assign_t _output_map[MODALAI_ESC_OUTPUT_CHANNELS] {{1, 1}, {2, 1}, {3, 1}, {4, 1}};
|
||||
MixingOutput _mixing_output{"MODALAI_ESC", MODALAI_ESC_OUTPUT_CHANNELS, *this, MixingOutput::SchedulingPolicy::Auto, false, false};
|
||||
|
||||
int _class_instance{-1};
|
||||
|
||||
perf_counter_t _cycle_perf;
|
||||
perf_counter_t _output_update_perf;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user