From a6bdee941f8dd2611cfb319dcb9b27d4f92e13b4 Mon Sep 17 00:00:00 2001 From: ligen Date: Thu, 21 Sep 2023 15:22:02 +0800 Subject: [PATCH 1/2] throttle must be in the mid when enter cam menu --- src/msp_displayport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msp_displayport.c b/src/msp_displayport.c index be8cdec..31e9139 100644 --- a/src/msp_displayport.c +++ b/src/msp_displayport.c @@ -1240,7 +1240,7 @@ void update_cms_menu(uint16_t roll, uint16_t pitch, uint16_t yaw, uint16_t throt uint8_t IS_HI_throttle = IS_HI(throttle); uint8_t IS_LO_throttle = IS_LO(throttle); - // uint8_t IS_MID_throttle = IS_MID(throttle); + uint8_t IS_MID_throttle = IS_MID(throttle); uint8_t IS_HI_pitch = IS_HI(pitch); uint8_t IS_LO_pitch = IS_LO(pitch); @@ -1261,7 +1261,7 @@ void update_cms_menu(uint16_t roll, uint16_t pitch, uint16_t yaw, uint16_t throt VirtualBtn = BTN_MID; } else { mid = 0; - if (IS_HI_yaw && IS_MID_roll && IS_MID_pitch) + if (IS_HI_yaw && IS_MID_roll && IS_MID_pitch && IS_MID_throttle) VirtualBtn = BTN_ENTER; else if (IS_LO_yaw && IS_MID_roll && IS_MID_pitch) VirtualBtn = BTN_EXIT; From d7c3b4e0a459bcfdcac177a58b9809e61e7d0176 Mon Sep 17 00:00:00 2001 From: ligen Date: Thu, 21 Sep 2023 18:25:08 +0800 Subject: [PATCH 2/2] Solve the possible conflict with iNav about stick cmd BTN_up, down, left and right --- src/msp_displayport.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/msp_displayport.c b/src/msp_displayport.c index 31e9139..3ff552c 100644 --- a/src/msp_displayport.c +++ b/src/msp_displayport.c @@ -1265,13 +1265,13 @@ void update_cms_menu(uint16_t roll, uint16_t pitch, uint16_t yaw, uint16_t throt VirtualBtn = BTN_ENTER; else if (IS_LO_yaw && IS_MID_roll && IS_MID_pitch) VirtualBtn = BTN_EXIT; - else if (IS_MID_yaw && IS_MID_roll && IS_HI_pitch) + else if (IS_MID_yaw && IS_MID_roll && IS_HI_pitch && !IS_HI_throttle) VirtualBtn = BTN_UP; - else if (IS_MID_yaw && IS_MID_roll && IS_LO_pitch) + else if (IS_MID_yaw && IS_MID_roll && IS_LO_pitch && !IS_HI_throttle) VirtualBtn = BTN_DOWN; - else if (IS_MID_yaw && IS_LO_roll && IS_MID_pitch) + else if (IS_MID_yaw && IS_LO_roll && IS_MID_pitch && !IS_HI_throttle) VirtualBtn = BTN_LEFT; - else if (IS_MID_yaw && IS_HI_roll && IS_MID_pitch) + else if (IS_MID_yaw && IS_HI_roll && IS_MID_pitch && !IS_HI_throttle) VirtualBtn = BTN_RIGHT; else VirtualBtn = BTN_INVALID;