2018-04-26 22:01:37 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <RC_Channel/RC_Channel.h>
|
|
|
|
|
|
|
|
class RC_Channel_Plane : public RC_Channel
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2018-09-05 01:22:14 -03:00
|
|
|
void init_aux_function(aux_func_t ch_option,
|
2020-06-02 23:21:50 -03:00
|
|
|
AuxSwitchPos ch_flag) override;
|
2021-02-24 05:48:16 -04:00
|
|
|
bool do_aux_function(aux_func_t ch_option, AuxSwitchPos) override;
|
2018-09-05 01:22:14 -03:00
|
|
|
|
2022-07-13 22:10:43 -03:00
|
|
|
// called when the mode switch changes position:
|
|
|
|
void mode_switch_changed(modeswitch_pos_t new_pos) override;
|
|
|
|
|
2018-04-26 22:01:37 -03:00
|
|
|
private:
|
|
|
|
|
2019-03-19 18:09:56 -03:00
|
|
|
void do_aux_function_change_mode(Mode::Number number,
|
2020-06-02 23:21:50 -03:00
|
|
|
AuxSwitchPos ch_flag);
|
2020-01-02 15:06:39 -04:00
|
|
|
|
2021-09-10 03:28:21 -03:00
|
|
|
#if HAL_QUADPLANE_ENABLED
|
2020-06-02 23:21:50 -03:00
|
|
|
void do_aux_function_q_assist_state(AuxSwitchPos ch_flag);
|
2021-09-10 03:28:21 -03:00
|
|
|
#endif
|
2020-07-15 16:22:50 -03:00
|
|
|
|
|
|
|
void do_aux_function_crow_mode(AuxSwitchPos ch_flag);
|
2020-07-13 05:45:57 -03:00
|
|
|
|
|
|
|
void do_aux_function_soaring_3pos(AuxSwitchPos ch_flag);
|
2020-10-02 21:52:56 -03:00
|
|
|
|
|
|
|
void do_aux_function_flare(AuxSwitchPos ch_flag);
|
|
|
|
|
2018-04-26 22:01:37 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
class RC_Channels_Plane : public RC_Channels
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
RC_Channel_Plane obj_channels[NUM_RC_CHANNELS];
|
|
|
|
RC_Channel_Plane *channel(const uint8_t chan) override {
|
2019-12-19 02:37:07 -04:00
|
|
|
if (chan >= NUM_RC_CHANNELS) {
|
2018-04-26 22:01:37 -03:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return &obj_channels[chan];
|
|
|
|
}
|
|
|
|
|
2018-08-03 06:56:58 -03:00
|
|
|
bool has_valid_input() const override;
|
|
|
|
|
2020-04-02 17:44:24 -03:00
|
|
|
RC_Channel *get_arming_channel(void) const override;
|
|
|
|
|
2022-07-13 22:10:43 -03:00
|
|
|
void read_mode_switch() override;
|
|
|
|
|
2018-04-26 22:01:37 -03:00
|
|
|
protected:
|
|
|
|
|
|
|
|
// note that these callbacks are not presently used on Plane:
|
|
|
|
int8_t flight_mode_channel_number() const override;
|
|
|
|
|
|
|
|
};
|