mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +03:00
Added stick commands for camera control
This commit is contained in:
parent
cc358dc405
commit
65476c506c
1 changed files with 18 additions and 0 deletions
|
@ -34,6 +34,8 @@
|
|||
#include "config/parameter_group.h"
|
||||
#include "config/parameter_group_ids.h"
|
||||
|
||||
#include "drivers/camera_control.h"
|
||||
|
||||
#include "fc/config.h"
|
||||
#include "fc/fc_core.h"
|
||||
#include "fc/rc_controls.h"
|
||||
|
@ -301,6 +303,22 @@ void processRcStickPositions(throttleStatus_e throttleStatus)
|
|||
vtxDecrementChannel();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_CAMERA_CONTROL
|
||||
if (rcSticks == THR_LO + YAW_CE + PIT_LO + ROL_CE) {
|
||||
cameraControlKeyPress(CAMERA_CONTROL_KEY_ENTER, 0);
|
||||
} else if (rcSticks == THR_CE + YAW_CE + PIT_CE + ROL_LO) {
|
||||
cameraControlKeyPress(CAMERA_CONTROL_KEY_LEFT, 0);
|
||||
} else if (rcSticks == THR_CE + YAW_CE + PIT_HI + ROL_CE) {
|
||||
cameraControlKeyPress(CAMERA_CONTROL_KEY_UP, 0);
|
||||
} else if (rcSticks == THR_CE + YAW_CE + PIT_CE + ROL_HI) {
|
||||
cameraControlKeyPress(CAMERA_CONTROL_KEY_RIGHT, 0);
|
||||
} else if (rcSticks == THR_CE + YAW_CE + PIT_LO + ROL_CE) {
|
||||
cameraControlKeyPress(CAMERA_CONTROL_KEY_DOWN, 0);
|
||||
} else if (rcSticks == THR_LO + YAW_CE + PIT_HI + ROL_CE) {
|
||||
cameraControlKeyPress(CAMERA_CONTROL_KEY_UP, 2000);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int32_t getRcStickDeflection(int32_t axis, uint16_t midrc) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue