mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 17:55:28 +03:00
osd joystick enabled buttons in armed state
This commit is contained in:
parent
58899c9e4b
commit
9f45d13a68
1 changed files with 12 additions and 10 deletions
|
@ -81,6 +81,7 @@ static void rcdeviceCameraControlProcess(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t behavior = RCDEVICE_PROTOCOL_CAM_CTRL_UNKNOWN_CAMERA_OPERATION;
|
uint8_t behavior = RCDEVICE_PROTOCOL_CAM_CTRL_UNKNOWN_CAMERA_OPERATION;
|
||||||
|
uint8_t behavior1 = RCDEVICE_PROTOCOL_CAM_CTRL_UNKNOWN_CAMERA_OPERATION;
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case BOXCAMERA1:
|
case BOXCAMERA1:
|
||||||
if (isFeatureSupported(RCDEVICE_PROTOCOL_FEATURE_SIMULATE_WIFI_BUTTON)) {
|
if (isFeatureSupported(RCDEVICE_PROTOCOL_FEATURE_SIMULATE_WIFI_BUTTON)) {
|
||||||
|
@ -90,11 +91,13 @@ static void rcdeviceCameraControlProcess(void)
|
||||||
if (!ARMING_FLAG(ARMED)) {
|
if (!ARMING_FLAG(ARMED)) {
|
||||||
behavior = RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_WIFI_BTN;
|
behavior = RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_WIFI_BTN;
|
||||||
}
|
}
|
||||||
|
behavior1 = RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_WIFI_BTN;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BOXCAMERA2:
|
case BOXCAMERA2:
|
||||||
if (isFeatureSupported(RCDEVICE_PROTOCOL_FEATURE_SIMULATE_POWER_BUTTON)) {
|
if (isFeatureSupported(RCDEVICE_PROTOCOL_FEATURE_SIMULATE_POWER_BUTTON)) {
|
||||||
behavior = RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_POWER_BTN;
|
behavior = RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_POWER_BTN;
|
||||||
|
behavior1 = RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_POWER_BTN;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BOXCAMERA3:
|
case BOXCAMERA3:
|
||||||
|
@ -103,20 +106,20 @@ static void rcdeviceCameraControlProcess(void)
|
||||||
if (!ARMING_FLAG(ARMED)) {
|
if (!ARMING_FLAG(ARMED)) {
|
||||||
behavior = RCDEVICE_PROTOCOL_CAM_CTRL_CHANGE_MODE;
|
behavior = RCDEVICE_PROTOCOL_CAM_CTRL_CHANGE_MODE;
|
||||||
}
|
}
|
||||||
|
behavior1 = RCDEVICE_PROTOCOL_CAM_CTRL_CHANGE_MODE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (behavior != RCDEVICE_PROTOCOL_CAM_CTRL_UNKNOWN_CAMERA_OPERATION) {
|
if ((behavior != RCDEVICE_PROTOCOL_CAM_CTRL_UNKNOWN_CAMERA_OPERATION) && rcdeviceIsEnabled()) {
|
||||||
if ( rcdeviceIsEnabled() ) {
|
runcamDeviceSimulateCameraButton(camDevice, behavior);
|
||||||
runcamDeviceSimulateCameraButton(camDevice, behavior);
|
switchStates[switchIndex].isActivated = true;
|
||||||
}
|
}
|
||||||
#ifndef UNIT_TEST
|
#ifndef UNIT_TEST
|
||||||
#ifdef USE_LED_STRIP
|
#ifdef USE_LED_STRIP
|
||||||
else if (osdJoystickEnabled()) {
|
else if ((behavior1 != RCDEVICE_PROTOCOL_CAM_CTRL_UNKNOWN_CAMERA_OPERATION) && osdJoystickEnabled()) {
|
||||||
|
switch (behavior1) {
|
||||||
switch (behavior) {
|
|
||||||
case RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_WIFI_BTN:
|
case RCDEVICE_PROTOCOL_CAM_CTRL_SIMULATE_WIFI_BTN:
|
||||||
osdJoystickSimulate5KeyButtonPress(RCDEVICE_CAM_KEY_ENTER);
|
osdJoystickSimulate5KeyButtonPress(RCDEVICE_CAM_KEY_ENTER);
|
||||||
break;
|
break;
|
||||||
|
@ -127,11 +130,10 @@ static void rcdeviceCameraControlProcess(void)
|
||||||
osdJoystickSimulate5KeyButtonPress(RCDEVICE_CAM_KEY_DOWN);
|
osdJoystickSimulate5KeyButtonPress(RCDEVICE_CAM_KEY_DOWN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
switchStates[switchIndex].isActivated = true;
|
switchStates[switchIndex].isActivated = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#ifndef UNIT_TEST
|
#ifndef UNIT_TEST
|
||||||
#ifdef USE_LED_STRIP
|
#ifdef USE_LED_STRIP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue