mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmsUpdate(uint32_t currentTimeUs)
|
static void cmsUpdate(uint32_t currentTimeUs)
|
||||||
{
|
{
|
||||||
|
if (IS_RC_MODE_ACTIVE(BOXPARALYZE)
|
||||||
#ifdef USE_RCDEVICE
|
#ifdef USE_RCDEVICE
|
||||||
if(rcdeviceInMenu) {
|
|| rcdeviceInMenu
|
||||||
return ;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_USB_CDC_HID
|
#ifdef USE_USB_CDC_HID
|
||||||
if (getBatteryCellCount() == 0 && usbDevConfig()->type == COMPOSITE) {
|
|| (getBatteryCellCount() == 0 && usbDevConfig()->type == COMPOSITE)
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int16_t rcDelayMs = BUTTON_TIME;
|
static int16_t rcDelayMs = BUTTON_TIME;
|
||||||
static int holdCount = 1;
|
static int holdCount = 1;
|
||||||
|
|
|
@ -50,7 +50,6 @@ bool cmsDisplayPortSelect(displayPort_t *instance);
|
||||||
void cmsMenuOpen(void);
|
void cmsMenuOpen(void);
|
||||||
long cmsMenuChange(displayPort_t *pPort, const void *ptr);
|
long cmsMenuChange(displayPort_t *pPort, const void *ptr);
|
||||||
long cmsMenuExit(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);
|
void cmsSetExternKey(cms_key_e extKey);
|
||||||
|
|
||||||
#define CMS_STARTUP_HELP_TEXT1 "MENU:THR MID"
|
#define CMS_STARTUP_HELP_TEXT1 "MENU:THR MID"
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
|
|
||||||
#include "cli/cli.h"
|
#include "cli/cli.h"
|
||||||
|
|
||||||
|
#include "cms/cms.h"
|
||||||
|
|
||||||
#include "common/axis.h"
|
#include "common/axis.h"
|
||||||
#include "common/filter.h"
|
#include "common/filter.h"
|
||||||
#include "common/maths.h"
|
#include "common/maths.h"
|
||||||
|
@ -836,7 +838,13 @@ bool processRx(timeUs_t currentTimeUs)
|
||||||
disarmAt = currentTimeUs + autoDisarmDelayUs; // extend auto-disarm timer
|
disarmAt = currentTimeUs + autoDisarmDelayUs; // extend auto-disarm timer
|
||||||
}
|
}
|
||||||
|
|
||||||
processRcStickPositions();
|
if (!IS_RC_MODE_ACTIVE(BOXPARALYZE)
|
||||||
|
#ifdef USE_CMS
|
||||||
|
&& !cmsInMenu
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
|
processRcStickPositions();
|
||||||
|
}
|
||||||
|
|
||||||
if (featureIsEnabled(FEATURE_INFLIGHT_ACC_CAL)) {
|
if (featureIsEnabled(FEATURE_INFLIGHT_ACC_CAL)) {
|
||||||
updateInflightCalibrationState();
|
updateInflightCalibrationState();
|
||||||
|
@ -851,7 +859,7 @@ bool processRx(timeUs_t currentTimeUs)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!cliMode) {
|
if (!cliMode && !IS_RC_MODE_ACTIVE(BOXPARALYZE)) {
|
||||||
processRcAdjustments(currentControlRateProfile);
|
processRcAdjustments(currentControlRateProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
|
||||||
#include "cms/cms.h"
|
|
||||||
|
|
||||||
#include "common/axis.h"
|
#include "common/axis.h"
|
||||||
#include "common/maths.h"
|
#include "common/maths.h"
|
||||||
|
|
||||||
|
@ -136,6 +134,7 @@ throttleStatus_e calculateThrottleStatus(void)
|
||||||
rcDelayMs -= (t); \
|
rcDelayMs -= (t); \
|
||||||
doNotRepeat = false; \
|
doNotRepeat = false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
void processRcStickPositions()
|
void processRcStickPositions()
|
||||||
{
|
{
|
||||||
// time the sticks are maintained
|
// time the sticks are maintained
|
||||||
|
@ -146,12 +145,6 @@ void processRcStickPositions()
|
||||||
static uint8_t rcDisarmTicks;
|
static uint8_t rcDisarmTicks;
|
||||||
static bool doNotRepeat;
|
static bool doNotRepeat;
|
||||||
|
|
||||||
#ifdef USE_CMS
|
|
||||||
if (cmsInMenu) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// checking sticks positions
|
// checking sticks positions
|
||||||
uint8_t stTmp = 0;
|
uint8_t stTmp = 0;
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
|
|
|
@ -30,6 +30,7 @@ extern "C" {
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
#include "cms/cms.h"
|
#include "cms/cms.h"
|
||||||
#include "cms/cms_types.h"
|
#include "cms/cms_types.h"
|
||||||
|
#include "fc/rc_modes.h"
|
||||||
#include "fc/runtime_config.h"
|
#include "fc/runtime_config.h"
|
||||||
void cmsMenuOpen(void);
|
void cmsMenuOpen(void);
|
||||||
long cmsMenuBack(displayPort_t *pDisplay);
|
long cmsMenuBack(displayPort_t *pDisplay);
|
||||||
|
@ -145,4 +146,5 @@ void stopPwmAllMotors(void) {}
|
||||||
void systemReset(void) {}
|
void systemReset(void) {}
|
||||||
void setArmingDisabled(armingDisableFlags_e flag) { UNUSED(flag); }
|
void setArmingDisabled(armingDisableFlags_e flag) { UNUSED(flag); }
|
||||||
void unsetArmingDisabled(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