mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 05:45:31 +03:00
Revert left stick constraints and introduce context
This commit is contained in:
parent
e955fa9a84
commit
4a2ef89ea8
4 changed files with 17 additions and 6 deletions
|
@ -130,7 +130,7 @@ static displayPort_t *cmsDisplayPortSelectNext(void)
|
|||
#define RIGHT_MENU_COLUMN(p) ((p)->cols - 8)
|
||||
#define MAX_MENU_ITEMS(p) ((p)->rows - 2)
|
||||
|
||||
static bool cmsInMenu = false;
|
||||
bool cmsInMenu = false;
|
||||
|
||||
typedef struct cmsCtx_s {
|
||||
const CMS_Menu *menu; // menu for this context
|
||||
|
@ -913,19 +913,19 @@ void cmsUpdate(uint32_t currentTimeUs)
|
|||
if (IS_MID(THROTTLE) && IS_LO(YAW) && IS_HI(PITCH) && !ARMING_FLAG(ARMED)) {
|
||||
key = KEY_MENU;
|
||||
}
|
||||
else if (IS_MID(THROTTLE) && IS_MID(YAW) && IS_MID(ROLL) && IS_HI(PITCH)) {
|
||||
else if (IS_HI(PITCH)) {
|
||||
key = KEY_UP;
|
||||
}
|
||||
else if (IS_MID(THROTTLE) && IS_MID(YAW) && IS_MID(ROLL) && IS_LO(PITCH)) {
|
||||
else if (IS_LO(PITCH)) {
|
||||
key = KEY_DOWN;
|
||||
}
|
||||
else if (IS_MID(THROTTLE) && IS_MID(YAW) && IS_LO(ROLL) && IS_MID(PITCH)) {
|
||||
else if (IS_LO(ROLL)) {
|
||||
key = KEY_LEFT;
|
||||
}
|
||||
else if (IS_MID(THROTTLE) && IS_MID(YAW) && IS_HI(ROLL) && IS_MID(PITCH)) {
|
||||
else if (IS_HI(ROLL)) {
|
||||
key = KEY_RIGHT;
|
||||
}
|
||||
else if ((IS_HI(YAW) || IS_LO(YAW)) && IS_MID(THROTTLE) && IS_MID(ROLL) && IS_MID(PITCH))
|
||||
else if (IS_HI(YAW) || IS_LO(YAW))
|
||||
{
|
||||
key = KEY_ESC;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue