1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 09:45:33 +03:00

osd joystick enabled buttons in armed state

This commit is contained in:
Roman Lut 2023-10-09 14:39:45 +02:00
parent 58899c9e4b
commit 9f45d13a68

View file

@ -81,6 +81,7 @@ static void rcdeviceCameraControlProcess(void)
}
uint8_t behavior = RCDEVICE_PROTOCOL_CAM_CTRL_UNKNOWN_CAMERA_OPERATION;
uint8_t behavior1 = RCDEVICE_PROTOCOL_CAM_CTRL_UNKNOWN_CAMERA_OPERATION;
switch (i) {
case BOXCAMERA1:
if (isFeatureSupported(RCDEVICE_PROTOCOL_FEATURE_SIMULATE_WIFI_BUTTON)) {
@ -90,11 +91,13 @@ static void rcdeviceCameraControlProcess(void)
if (!ARMING_FLAG(ARMED)) {
behavior = RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_WIFI_BTN;
}
behavior1 = RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_WIFI_BTN;
}
break;
case BOXCAMERA2:
if (isFeatureSupported(RCDEVICE_PROTOCOL_FEATURE_SIMULATE_POWER_BUTTON)) {
behavior = RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_POWER_BTN;
behavior1 = RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_POWER_BTN;
}
break;
case BOXCAMERA3:
@ -103,20 +106,20 @@ static void rcdeviceCameraControlProcess(void)
if (!ARMING_FLAG(ARMED)) {
behavior = RCDEVICE_PROTOCOL_CAM_CTRL_CHANGE_MODE;
}
behavior1 = RCDEVICE_PROTOCOL_CAM_CTRL_CHANGE_MODE;
}
break;
default:
break;
}
if (behavior != RCDEVICE_PROTOCOL_CAM_CTRL_UNKNOWN_CAMERA_OPERATION) {
if ( rcdeviceIsEnabled() ) {
runcamDeviceSimulateCameraButton(camDevice, behavior);
}
if ((behavior != RCDEVICE_PROTOCOL_CAM_CTRL_UNKNOWN_CAMERA_OPERATION) && rcdeviceIsEnabled()) {
runcamDeviceSimulateCameraButton(camDevice, behavior);
switchStates[switchIndex].isActivated = true;
}
#ifndef UNIT_TEST
#ifdef USE_LED_STRIP
else if (osdJoystickEnabled()) {
switch (behavior) {
else if ((behavior1 != RCDEVICE_PROTOCOL_CAM_CTRL_UNKNOWN_CAMERA_OPERATION) && osdJoystickEnabled()) {
switch (behavior1) {
case RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_WIFI_BTN:
osdJoystickSimulate5KeyButtonPress(RCDEVICE_CAM_KEY_ENTER);
break;
@ -127,11 +130,10 @@ static void rcdeviceCameraControlProcess(void)
osdJoystickSimulate5KeyButtonPress(RCDEVICE_CAM_KEY_DOWN);
break;
}
}
#endif
#endif
switchStates[switchIndex].isActivated = true;
}
#endif
#endif
} else {
#ifndef UNIT_TEST
#ifdef USE_LED_STRIP