mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 11:03:33 +08:00
Add the ability to reset a mixer group. Report the remaining buffer size from load_from_buf.
This commit is contained in:
@@ -64,14 +64,7 @@ MixerGroup::MixerGroup(ControlCallback control_cb, uintptr_t cb_handle) :
|
||||
|
||||
MixerGroup::~MixerGroup()
|
||||
{
|
||||
Mixer *mixer;
|
||||
|
||||
/* discard sub-mixers */
|
||||
while (_first != nullptr) {
|
||||
mixer = _first;
|
||||
_first = mixer->_next;
|
||||
delete mixer;
|
||||
}
|
||||
reset();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -88,6 +81,19 @@ MixerGroup::add_mixer(Mixer *mixer)
|
||||
mixer->_next = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
MixerGroup::reset()
|
||||
{
|
||||
Mixer *mixer;
|
||||
|
||||
/* discard sub-mixers */
|
||||
while (_first != nullptr) {
|
||||
mixer = _first;
|
||||
_first = mixer->_next;
|
||||
delete mixer;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned
|
||||
MixerGroup::mix(float *outputs, unsigned space)
|
||||
{
|
||||
@@ -114,7 +120,7 @@ MixerGroup::groups_required(uint32_t &groups)
|
||||
}
|
||||
|
||||
int
|
||||
MixerGroup::load_from_buf(const char *buf, unsigned buflen)
|
||||
MixerGroup::load_from_buf(const char *buf, unsigned &buflen)
|
||||
{
|
||||
int ret = -1;
|
||||
const char *end = buf + buflen;
|
||||
|
||||
Reference in New Issue
Block a user