rc_update: fix on-off-switch with negative threshold values

This commit is contained in:
Matthias Grob
2023-07-11 15:58:48 +02:00
parent 1fa5136e30
commit 42fa41e601
3 changed files with 43 additions and 25 deletions
+5 -4
View File
@@ -118,15 +118,16 @@ protected:
float get_rc_value(uint8_t func, float min_value, float max_value) const;
/**
* Get switch position for specified function.
* Get on/off switch position from the RC channel of the specified function
*
* @param function according to rc_channels_s::FUNCTION_XXX
* @param threshold according to RC_XXX_TH parameters, negative means on and off are flipped
*/
switch_pos_t get_rc_sw2pos_position(uint8_t func, float on_th) const;
switch_pos_t getRCSwitchOnOffPosition(uint8_t function, float threshold) const;
/**
* Update parameters from RC channels if the functionality is activated and the
* input has changed since the last update
*
* @param
*/
void set_params_from_rc();