2018-06-04 00:06:32 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <RC_Channel/RC_Channel.h>
|
2020-01-07 01:12:54 -04:00
|
|
|
#include <AP_Motors/AP_Motors.h>
|
2019-09-07 20:33:56 -03:00
|
|
|
#include "mode.h"
|
2018-06-04 00:06:32 -03:00
|
|
|
|
|
|
|
class RC_Channel_Copter : public RC_Channel
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2020-06-02 23:21:50 -03:00
|
|
|
void init_aux_function(aux_func_t ch_option, AuxSwitchPos) override;
|
2021-02-24 05:48:15 -04:00
|
|
|
bool do_aux_function(aux_func_t ch_option, AuxSwitchPos) override;
|
2018-06-04 00:06:32 -03:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2019-09-07 20:33:56 -03:00
|
|
|
void do_aux_function_change_mode(const Mode::Number mode,
|
2020-06-02 23:21:50 -03:00
|
|
|
const AuxSwitchPos ch_flag);
|
2020-06-16 17:01:19 -03:00
|
|
|
void do_aux_function_change_air_mode(const AuxSwitchPos ch_flag);
|
2018-06-04 00:06:32 -03:00
|
|
|
|
|
|
|
// called when the mode switch changes position:
|
|
|
|
void mode_switch_changed(modeswitch_pos_t new_pos) override;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class RC_Channels_Copter : public RC_Channels
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
bool has_valid_input() const override;
|
|
|
|
|
2020-04-02 17:44:43 -03:00
|
|
|
RC_Channel *get_arming_channel(void) const override;
|
|
|
|
|
2018-06-04 00:06:32 -03:00
|
|
|
RC_Channel_Copter obj_channels[NUM_RC_CHANNELS];
|
|
|
|
RC_Channel_Copter *channel(const uint8_t chan) override {
|
2019-12-19 02:37:07 -04:00
|
|
|
if (chan >= NUM_RC_CHANNELS) {
|
2018-06-04 00:06:32 -03:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return &obj_channels[chan];
|
|
|
|
}
|
|
|
|
|
2021-09-17 20:52:34 -03:00
|
|
|
// returns true if throttle arming checks should be run
|
|
|
|
bool arming_check_throttle() const override;
|
|
|
|
|
2018-06-04 00:06:32 -03:00
|
|
|
protected:
|
|
|
|
|
|
|
|
int8_t flight_mode_channel_number() const override;
|
|
|
|
|
|
|
|
};
|