mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 04:45:24 +03:00
Extend the scope of BOXPARALYZE to cover stick commands, adjustments, and CMS.
This commit is contained in:
parent
ba95968e08
commit
4fb58b340e
5 changed files with 19 additions and 17 deletions
|
@ -1079,18 +1079,18 @@ uint16_t cmsHandleKeyWithRepeat(displayPort_t *pDisplay, cms_key_e key, int repe
|
|||
return ret;
|
||||
}
|
||||
|
||||
void cmsUpdate(uint32_t currentTimeUs)
|
||||
static void cmsUpdate(uint32_t currentTimeUs)
|
||||
{
|
||||
if (IS_RC_MODE_ACTIVE(BOXPARALYZE)
|
||||
#ifdef USE_RCDEVICE
|
||||
if(rcdeviceInMenu) {
|
||||
return ;
|
||||
}
|
||||
|| rcdeviceInMenu
|
||||
#endif
|
||||
#ifdef USE_USB_CDC_HID
|
||||
if (getBatteryCellCount() == 0 && usbDevConfig()->type == COMPOSITE) {
|
||||
|| (getBatteryCellCount() == 0 && usbDevConfig()->type == COMPOSITE)
|
||||
#endif
|
||||
) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int16_t rcDelayMs = BUTTON_TIME;
|
||||
static int holdCount = 1;
|
||||
|
|
|
@ -50,7 +50,6 @@ bool cmsDisplayPortSelect(displayPort_t *instance);
|
|||
void cmsMenuOpen(void);
|
||||
long cmsMenuChange(displayPort_t *pPort, const void *ptr);
|
||||
long cmsMenuExit(displayPort_t *pPort, const void *ptr);
|
||||
void cmsUpdate(uint32_t currentTimeUs);
|
||||
void cmsSetExternKey(cms_key_e extKey);
|
||||
|
||||
#define CMS_STARTUP_HELP_TEXT1 "MENU:THR MID"
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
|
||||
#include "cli/cli.h"
|
||||
|
||||
#include "cms/cms.h"
|
||||
|
||||
#include "common/axis.h"
|
||||
#include "common/filter.h"
|
||||
#include "common/maths.h"
|
||||
|
@ -836,7 +838,13 @@ bool processRx(timeUs_t currentTimeUs)
|
|||
disarmAt = currentTimeUs + autoDisarmDelayUs; // extend auto-disarm timer
|
||||
}
|
||||
|
||||
if (!IS_RC_MODE_ACTIVE(BOXPARALYZE)
|
||||
#ifdef USE_CMS
|
||||
&& !cmsInMenu
|
||||
#endif
|
||||
) {
|
||||
processRcStickPositions();
|
||||
}
|
||||
|
||||
if (featureIsEnabled(FEATURE_INFLIGHT_ACC_CAL)) {
|
||||
updateInflightCalibrationState();
|
||||
|
@ -851,7 +859,7 @@ bool processRx(timeUs_t currentTimeUs)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (!cliMode) {
|
||||
if (!cliMode && !IS_RC_MODE_ACTIVE(BOXPARALYZE)) {
|
||||
processRcAdjustments(currentControlRateProfile);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
|
||||
#include "build/build_config.h"
|
||||
|
||||
#include "cms/cms.h"
|
||||
|
||||
#include "common/axis.h"
|
||||
#include "common/maths.h"
|
||||
|
||||
|
@ -136,6 +134,7 @@ throttleStatus_e calculateThrottleStatus(void)
|
|||
rcDelayMs -= (t); \
|
||||
doNotRepeat = false; \
|
||||
}
|
||||
|
||||
void processRcStickPositions()
|
||||
{
|
||||
// time the sticks are maintained
|
||||
|
@ -146,12 +145,6 @@ void processRcStickPositions()
|
|||
static uint8_t rcDisarmTicks;
|
||||
static bool doNotRepeat;
|
||||
|
||||
#ifdef USE_CMS
|
||||
if (cmsInMenu) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// checking sticks positions
|
||||
uint8_t stTmp = 0;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
|
|
@ -30,6 +30,7 @@ extern "C" {
|
|||
#include "target.h"
|
||||
#include "cms/cms.h"
|
||||
#include "cms/cms_types.h"
|
||||
#include "fc/rc_modes.h"
|
||||
#include "fc/runtime_config.h"
|
||||
void cmsMenuOpen(void);
|
||||
long cmsMenuBack(displayPort_t *pDisplay);
|
||||
|
@ -145,4 +146,5 @@ void stopPwmAllMotors(void) {}
|
|||
void systemReset(void) {}
|
||||
void setArmingDisabled(armingDisableFlags_e flag) { UNUSED(flag); }
|
||||
void unsetArmingDisabled(armingDisableFlags_e flag) { UNUSED(flag); }
|
||||
bool IS_RC_MODE_ACTIVE(boxId_e) { return false; }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue