1
0
Fork 0
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:
DieHertz 2017-05-18 19:06:12 +03:00
parent cc358dc405
commit 65476c506c

View file

@ -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) {