From 9d2c8efe15b8dc1974dd647badabdc8961e98f67 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Fri, 8 Mar 2024 22:03:33 -0500 Subject: [PATCH 01/99] Origin --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 5024b6fc93..69afceeca1 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -289,7 +289,7 @@ static void inavDraw() { // rotate to homeHeading // ... - // scale + // scale int8_t scaledHomeLon = translatedHomeLon / scaleFactor; int8_t scaledHomeLat = translatedHomeLat / scaleFactor; int8_t scaledCurrentLon = translatedCurrentLon / scaleFactor; From 7f247c5259f99a17be4138d6b7ec3647f58026ad Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 06:57:38 -0400 Subject: [PATCH 02/99] Updated config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2986032d6f..392822e0ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,3 +81,4 @@ workflows: branches: only: - master + \ No newline at end of file From 5842bed528aec030ffc1894a8f54282f3e20d44d Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:04:57 -0400 Subject: [PATCH 03/99] origin Branch --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 392822e0ef..123cd7031c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,25 +60,25 @@ workflows: filters: branches: ignore: - - master + - origin - build-std: filters: branches: only: - - master + - origin - build-std-dfplayer: filters: branches: only: - - master + - origin - build-heli: filters: branches: only: - - master + - origin - build-heli-dfplayer: filters: branches: only: - - master + - origin \ No newline at end of file From 073fadd1050ae5f3515f160d1b0605f8f8ceb817 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:07:47 -0400 Subject: [PATCH 04/99] yml --- .circleci/config.yml | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 123cd7031c..72ddd48389 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,29 +56,8 @@ jobs: workflows: openi6x-release-workflow: jobs: - - build-en: - filters: - branches: - ignore: - - origin - - build-std: - filters: - branches: - only: - - origin - build-std-dfplayer: filters: branches: only: - - origin - - build-heli: - filters: - branches: - only: - - origin - - build-heli-dfplayer: - filters: - branches: - only: - - origin - \ No newline at end of file + - origin \ No newline at end of file From 48c0d53659571dc705d292dcb530586a4ea8e664 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:09:50 -0400 Subject: [PATCH 05/99] Updated config.yml --- .circleci/config.yml | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 72ddd48389..0b37b21a0a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,16 +3,6 @@ version: 2.1 jobs: - build-std: - docker: - - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 - steps: - - checkout - - run: | - python3 ./tools/build-flysky.py -bI6X -tALL $PWD/ - - store_artifacts: - path: output - build-std-dfplayer: docker: - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 @@ -23,36 +13,6 @@ jobs: - store_artifacts: path: output - build-heli: - docker: - - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 - steps: - - checkout - - run: | - python3 ./tools/build-flysky.py -bI6X_HELI -tALL $PWD/ - - store_artifacts: - path: output - - build-heli-dfplayer: - docker: - - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 - steps: - - checkout - - run: | - python3 ./tools/build-flysky.py -bI6X_HELI_DFPLAYER -tALL $PWD/ - - store_artifacts: - path: output - - build-en: - docker: - - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 - steps: - - checkout - - run: | - python3 ./tools/build-flysky.py -bI6X_DFPLAYER -bI6X_HELI -bI6X -tEN $PWD/ - - store_artifacts: - path: output - workflows: openi6x-release-workflow: jobs: From ecff53764cb6dda5c9576029aaf98a054c53887d Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:17:30 -0400 Subject: [PATCH 06/99] py --- .circleci/config.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0b37b21a0a..82c4542419 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,25 @@ version: 2.1 jobs: + sonar-scan: + docker: + - image: cimg/python:3.10.4 + steps: + - checkout + - run: + name: Build + command: | + wget https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q3-update/+download/gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 -P /tmp + tar -C /tmp -xjf /tmp/gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 + export PATH=$PATH:/tmp/gcc-arm-none-eabi-4_7-2013q3/bin + pip3 install pillow libclang-py3 pyqt5 + sudo apt-get update -y + sudo apt-get install -y libclang-6.0-dev + curl -L -O https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip + unzip -o build-wrapper-linux-x86.zip + build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw_output ./tools/commit-tests.sh -Wno-error + - sonarcloud/scan + build-std-dfplayer: docker: - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 @@ -13,6 +32,7 @@ jobs: - store_artifacts: path: output + workflows: openi6x-release-workflow: jobs: From e3ac0dde1f10ab7eebe8cd119a17643b202e664d Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:19:26 -0400 Subject: [PATCH 07/99] master --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 82c4542419..b1426f9dfd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,4 +40,4 @@ workflows: filters: branches: only: - - origin \ No newline at end of file + - master \ No newline at end of file From b2095df81fb8442e40f558d49507905a0baa5bed Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:30:10 -0400 Subject: [PATCH 08/99] fix1-2 --- .circleci/config.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b1426f9dfd..a3eee20757 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,4 +40,16 @@ workflows: filters: branches: only: - - master \ No newline at end of file + - origin + - build-heli: + filters: + branches: + only: + - origin + - build-heli-dfplayer: + filters: + branches: + only: + - origin + + From 8d0e985f219fb88e8b0ebcd872bb257539d3e90b Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:30:33 -0400 Subject: [PATCH 09/99] fix2 --- .circleci/config.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a3eee20757..8a45a732a7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,15 +41,4 @@ workflows: branches: only: - origin - - build-heli: - filters: - branches: - only: - - origin - - build-heli-dfplayer: - filters: - branches: - only: - - origin - From 2ca51698229c5e3a67255b655efd2261db75ad33 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:30:56 -0400 Subject: [PATCH 10/99] masterFix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8a45a732a7..d96f1acf19 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,5 +40,5 @@ workflows: filters: branches: only: - - origin + - master From 82df5bbbe5791adf3b9f2b596766b6152e252a7d Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:36:33 -0400 Subject: [PATCH 11/99] reset --- .circleci/config.yml | 83 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index d96f1acf19..b1af47f956 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,3 +42,86 @@ workflows: only: - master +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/2.0/configuration-reference +version: 2.1 + +jobs: + build-std: + docker: + - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 + steps: + - checkout + - run: | + python3 ./tools/build-flysky.py -bI6X -tALL $PWD/ + - store_artifacts: + path: output + + build-std-dfplayer: + docker: + - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 + steps: + - checkout + - run: | + python3 ./tools/build-flysky.py -bI6X_DFPLAYER -tALL $PWD/ + - store_artifacts: + path: output + + build-heli: + docker: + - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 + steps: + - checkout + - run: | + python3 ./tools/build-flysky.py -bI6X_HELI -tALL $PWD/ + - store_artifacts: + path: output + + build-heli-dfplayer: + docker: + - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 + steps: + - checkout + - run: | + python3 ./tools/build-flysky.py -bI6X_HELI_DFPLAYER -tALL $PWD/ + - store_artifacts: + path: output + + build-en: + docker: + - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 + steps: + - checkout + - run: | + python3 ./tools/build-flysky.py -bI6X_DFPLAYER -bI6X_HELI -bI6X -tEN $PWD/ + - store_artifacts: + path: output + +workflows: + openi6x-release-workflow: + jobs: + - build-en: + filters: + branches: + ignore: + - master + - build-std: + filters: + branches: + only: + - master + - build-std-dfplayer: + filters: + branches: + only: + - master + - build-heli: + filters: + branches: + only: + - master + - build-heli-dfplayer: + filters: + branches: + only: + - master \ No newline at end of file From 8bb1567444f3601a4d10f28a51905c3591744d1b Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:38:32 -0400 Subject: [PATCH 12/99] new --- .circleci/config.yml | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b1af47f956..2a31022ab6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,50 +2,6 @@ # See: https://circleci.com/docs/2.0/configuration-reference version: 2.1 -jobs: - sonar-scan: - docker: - - image: cimg/python:3.10.4 - steps: - - checkout - - run: - name: Build - command: | - wget https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q3-update/+download/gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 -P /tmp - tar -C /tmp -xjf /tmp/gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 - export PATH=$PATH:/tmp/gcc-arm-none-eabi-4_7-2013q3/bin - pip3 install pillow libclang-py3 pyqt5 - sudo apt-get update -y - sudo apt-get install -y libclang-6.0-dev - curl -L -O https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip - unzip -o build-wrapper-linux-x86.zip - build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw_output ./tools/commit-tests.sh -Wno-error - - sonarcloud/scan - - build-std-dfplayer: - docker: - - image: ajjjjjjjj/opentx-docker-i6x:1.3.0 - steps: - - checkout - - run: | - python3 ./tools/build-flysky.py -bI6X_DFPLAYER -tALL $PWD/ - - store_artifacts: - path: output - - -workflows: - openi6x-release-workflow: - jobs: - - build-std-dfplayer: - filters: - branches: - only: - - master - -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/2.0/configuration-reference -version: 2.1 - jobs: build-std: docker: From e8ea5983947f8a762c3020ab708d59c8bb775552 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:39:24 -0400 Subject: [PATCH 13/99] Origin --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a31022ab6..338b493a3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,24 +60,24 @@ workflows: filters: branches: ignore: - - master + - Origin - build-std: filters: branches: only: - - master + - Origin - build-std-dfplayer: filters: branches: only: - - master + - Origin - build-heli: filters: branches: only: - - master + - Origin - build-heli-dfplayer: filters: branches: only: - - master \ No newline at end of file + - Origin \ No newline at end of file From ed577a988aba987f5dc88e8589f01f23a5b043c4 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:40:12 -0400 Subject: [PATCH 14/99] r1 --- .circleci/config.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 338b493a3c..a5f1448e84 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,16 +67,6 @@ workflows: only: - Origin - build-std-dfplayer: - filters: - branches: - only: - - Origin - - build-heli: - filters: - branches: - only: - - Origin - - build-heli-dfplayer: filters: branches: only: From 1c134af3abb1f773ecca6d69ac3ca2377cd3db2f Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 08:34:18 -0400 Subject: [PATCH 15/99] rm1 --- .circleci/config.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a5f1448e84..5a949d560a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,11 +56,6 @@ jobs: workflows: openi6x-release-workflow: jobs: - - build-en: - filters: - branches: - ignore: - - Origin - build-std: filters: branches: From 0d13a7ecad93da69d8d7bbce4ac4afcce0d87b92 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 08:42:16 -0400 Subject: [PATCH 16/99] S&E --- radio/src/targets/flysky/tools/inav.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 69afceeca1..381bc484a1 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -139,6 +139,11 @@ static void inavDraw() { lcdDrawSolidHorizontalLine(LCD_W - 26, 51, 32, FORCE); lcdDrawLine(LCD_W - 30, (LCD_H / 2) + FH / 2, LCD_W - 28, (LCD_H / 2) + FH / 2, DOTTED, FORCE); +//MAP-Direction-Legend + lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE); + lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE); +// + uint8_t rxBatt = 0, sats = 0; int32_t dist = 0, alt = 0, galt = 0, speed = 0, current = 0; From 5087cb43ec774e188a9559ea097e7c8c8bbb53c9 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 10 Mar 2024 08:50:39 -0400 Subject: [PATCH 17/99] EN --- tools/build-flysky.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tools/build-flysky.py b/tools/build-flysky.py index d91fdb56bc..5bf3e6ee1a 100755 --- a/tools/build-flysky.py +++ b/tools/build-flysky.py @@ -36,17 +36,7 @@ } translations = [ - "EN", - "PL", - "CZ", - "DE", - "ES", - "PT", - "NL", - "SE", - "FI", - "IT", - "FR" + "EN" ] common_options = { From 1e4730447aac30c1edf81c3dc14500791d47ffa5 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Wed, 3 Apr 2024 01:13:21 -0400 Subject: [PATCH 18/99] INAV-TimerFIx --- radio/src/gui/128x64/lcd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/128x64/lcd.cpp b/radio/src/gui/128x64/lcd.cpp index fc8db005b6..b532a64ba8 100644 --- a/radio/src/gui/128x64/lcd.cpp +++ b/radio/src/gui/128x64/lcd.cpp @@ -588,10 +588,10 @@ void drawTelemetryTopBar() { putsModelName(0, 0, g_model.header.name, g_eeGeneral.currModel, 0); uint8_t att = (IS_TXBATT_WARNING() ? BLINK : 0); - putsVBat(10*FW-1,0,att); + //putsVBat(10*FW-1,0,att); if (g_model.timers[0].mode) { att = (timersStates[0].val<0 ? BLINK : 0); - drawTimer(13*FW+5, 0, timersStates[0].val, att, att); + drawTimer(10*FW-5, 0, timersStates[0].val, att, att); } lcdInvertLine(0); } From 80bd96d40d48d46374129199e4a8565b2517e0ae Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Wed, 8 May 2024 22:29:09 -0400 Subject: [PATCH 19/99] V11.11.1 auto-set HOME Point --- radio/src/targets/flysky/tools/inav.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 381bc484a1..8f07aab438 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -79,7 +79,6 @@ static void inavSetHome() { inavData.homeLat = inavData.currentLat; inavData.homeLon = inavData.currentLon; // inavData.homeHeading = inavData.heading; - audioEvent(AU_SPECIAL_SOUND_WARN1); } static void inavDrawHome(uint8_t x, uint8_t y) { @@ -304,6 +303,11 @@ static void inavDraw() { inavSetHome(); } + //auto-set HOME Point + if (sats >= 6 && galt<2 && current<1 && speed<5 && dist<2) { + inavSetHome(); + } + // translate to LCD center space and draw inavDrawHome(BBOX_CENTER_X + scaledHomeLat, BBOX_CENTER_Y - scaledHomeLon); inavDrawCraft(BBOX_CENTER_X + scaledCurrentLat, BBOX_CENTER_Y - scaledCurrentLon); @@ -325,6 +329,7 @@ void inavRun(event_t event) { popMenu(); } else if (event == EVT_KEY_LONG(KEY_ENTER)) { // set home on long press OK inavSetHome(); + audioEvent(AU_SPECIAL_SOUND_WARN2); } inavDraw(); From df0a6f248a8426e3bead9757d7d8768f16ba1953 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Wed, 15 May 2024 09:54:17 -0400 Subject: [PATCH 20/99] v3 --- radio/src/targets/flysky/tools/inav.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 8f07aab438..5c870a3d07 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -274,6 +274,15 @@ static void inavDraw() { drawValueWithUnit(LCD_W - 6, 0, rxBatt, UNIT_VOLTS, PREC1 | RIGHT); drawTelemetryTopBar(); // after rxBatt to add INVERS + + if (sats >= 6 && inavData.homeLat == 0) { + inavSetHome(); + } + //auto-set HOME Point + if (sats >= 6 && galt<2 && current<1 && speed<5 && dist<2) { + inavSetHome(); + } + int32_t h = inavData.homeLat - inavData.currentLat; int32_t w = inavData.homeLon - inavData.currentLon; int32_t d = isqrt32((w * w) + (h * h)); @@ -299,14 +308,6 @@ static void inavDraw() { int8_t scaledCurrentLon = translatedCurrentLon / scaleFactor; int8_t scaledCurrentLat = translatedCurrentLat / scaleFactor; - if (sats >= 6 && inavData.homeLat == 0) { - inavSetHome(); - } - - //auto-set HOME Point - if (sats >= 6 && galt<2 && current<1 && speed<5 && dist<2) { - inavSetHome(); - } // translate to LCD center space and draw inavDrawHome(BBOX_CENTER_X + scaledHomeLat, BBOX_CENTER_Y - scaledHomeLon); From 4053621522415de50c583fc3e3e0696c65fad26c Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Wed, 15 May 2024 10:05:52 -0400 Subject: [PATCH 21/99] v4 --- radio/src/targets/flysky/tools/inav.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 5c870a3d07..4a8c1de58e 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -277,10 +277,12 @@ static void inavDraw() { if (sats >= 6 && inavData.homeLat == 0) { inavSetHome(); + lcdDrawText(LCD_W/2-1 , LCD_H-7, "-", SMLSIZE); } //auto-set HOME Point if (sats >= 6 && galt<2 && current<1 && speed<5 && dist<2) { inavSetHome(); + lcdDrawText(LCD_W/2-1 , LCD_H-7, "-", SMLSIZE); } int32_t h = inavData.homeLat - inavData.currentLat; From 53024e1fcc1dddcd6460d7b205efd3c3e5e5840d Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Wed, 15 May 2024 10:07:39 -0400 Subject: [PATCH 22/99] v5 --- radio/src/targets/flysky/tools/inav.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 4a8c1de58e..8ed3a7f6da 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -79,6 +79,7 @@ static void inavSetHome() { inavData.homeLat = inavData.currentLat; inavData.homeLon = inavData.currentLon; // inavData.homeHeading = inavData.heading; + lcdDrawText(LCD_W/2-1 , LCD_H-7, "***", SMLSIZE);///indicator } static void inavDrawHome(uint8_t x, uint8_t y) { @@ -276,13 +277,11 @@ static void inavDraw() { if (sats >= 6 && inavData.homeLat == 0) { - inavSetHome(); - lcdDrawText(LCD_W/2-1 , LCD_H-7, "-", SMLSIZE); + inavSetHome(); } //auto-set HOME Point if (sats >= 6 && galt<2 && current<1 && speed<5 && dist<2) { - inavSetHome(); - lcdDrawText(LCD_W/2-1 , LCD_H-7, "-", SMLSIZE); + inavSetHome(); } int32_t h = inavData.homeLat - inavData.currentLat; From aba0e5d5ccb2d1793b40952895bd7711a59f87ae Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Wed, 15 May 2024 10:09:05 -0400 Subject: [PATCH 23/99] v5-1 (AutoSetHome) --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 8ed3a7f6da..16d1be8de0 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -79,7 +79,7 @@ static void inavSetHome() { inavData.homeLat = inavData.currentLat; inavData.homeLon = inavData.currentLon; // inavData.homeHeading = inavData.heading; - lcdDrawText(LCD_W/2-1 , LCD_H-7, "***", SMLSIZE);///indicator + lcdDrawText(LCD_W/2-2 , LCD_H-7, "***", SMLSIZE);///indicator } static void inavDrawHome(uint8_t x, uint8_t y) { From ca1f7289beaa86ee3bb4c8ffc569cc741490adfd Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 14:10:29 -0400 Subject: [PATCH 24/99] v6 --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 16d1be8de0..7c5daa994a 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -79,7 +79,7 @@ static void inavSetHome() { inavData.homeLat = inavData.currentLat; inavData.homeLon = inavData.currentLon; // inavData.homeHeading = inavData.heading; - lcdDrawText(LCD_W/2-2 , LCD_H-7, "***", SMLSIZE);///indicator + lcdDrawText(LCD_W/2-4 , LCD_H-10, "***", SMLSIZE);///indicator } static void inavDrawHome(uint8_t x, uint8_t y) { @@ -280,7 +280,7 @@ static void inavDraw() { inavSetHome(); } //auto-set HOME Point - if (sats >= 6 && galt<2 && current<1 && speed<5 && dist<2) { + if (sats >= 6 && current<1 && speed<5 && dist<2) { //&& galt<2 inavSetHome(); } From bfdee1f0f4410ae61ffc2703879da71dcdb5033d Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 14:25:41 -0400 Subject: [PATCH 25/99] V7 --- radio/src/targets/flysky/tools/inav.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 7c5daa994a..0dc85235d9 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -281,7 +281,8 @@ static void inavDraw() { } //auto-set HOME Point if (sats >= 6 && current<1 && speed<5 && dist<2) { //&& galt<2 - inavSetHome(); + inavSetHome(); + audioEvent(AU_SPECIAL_SOUND_TICK); } int32_t h = inavData.homeLat - inavData.currentLat; From e436f3247b473d3ba1fe2a2769ddeebb0b7442f4 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 14:35:41 -0400 Subject: [PATCH 26/99] V8 --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 0dc85235d9..344f817888 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -280,7 +280,7 @@ static void inavDraw() { inavSetHome(); } //auto-set HOME Point - if (sats >= 6 && current<1 && speed<5 && dist<2) { //&& galt<2 + if (sats >= 6 && current<1 && speed<2 ) { //&& dist<2 && galt<2 inavSetHome(); audioEvent(AU_SPECIAL_SOUND_TICK); } From f93016c050380a35a0c1c9dd7a14a6d1750758fe Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 14:40:50 -0400 Subject: [PATCH 27/99] V9 --- radio/src/targets/flysky/tools/inav.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 344f817888..08c25b53c3 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -277,10 +277,11 @@ static void inavDraw() { if (sats >= 6 && inavData.homeLat == 0) { - inavSetHome(); + inavSetHome(); + audioEvent(AU_SPECIAL_SOUND_RATATA); } //auto-set HOME Point - if (sats >= 6 && current<1 && speed<2 ) { //&& dist<2 && galt<2 + if (sats >= 6 ) { //&& current<1 && speed<2 && dist<2 && galt<2 inavSetHome(); audioEvent(AU_SPECIAL_SOUND_TICK); } From 09cd27536bb43927451ade9ff0ca532cc9c7bbce Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 14:45:58 -0400 Subject: [PATCH 28/99] v10 --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 08c25b53c3..a4535529f9 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -281,7 +281,7 @@ static void inavDraw() { audioEvent(AU_SPECIAL_SOUND_RATATA); } //auto-set HOME Point - if (sats >= 6 ) { //&& current<1 && speed<2 && dist<2 && galt<2 + if (sats >= 6 && current<1) { //&& current<1 && speed<2 && dist<2 && galt<2 inavSetHome(); audioEvent(AU_SPECIAL_SOUND_TICK); } From 654d2cc426bbeffad845b9eb83d5b94e26c460f8 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 14:46:44 -0400 Subject: [PATCH 29/99] V11 --- radio/src/targets/flysky/tools/inav.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index a4535529f9..af6665122c 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -281,9 +281,11 @@ static void inavDraw() { audioEvent(AU_SPECIAL_SOUND_RATATA); } //auto-set HOME Point - if (sats >= 6 && current<1) { //&& current<1 && speed<2 && dist<2 && galt<2 - inavSetHome(); - audioEvent(AU_SPECIAL_SOUND_TICK); + if (sats >= 6 && current<1) { //&& speed<2 && dist<2 && galt<2 + if(speed<2){ + inavSetHome(); + audioEvent(AU_SPECIAL_SOUND_TICK); + } } int32_t h = inavData.homeLat - inavData.currentLat; From 1189689e8573074791391de7c71b1bc742f174ba Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 14:47:15 -0400 Subject: [PATCH 30/99] v12 --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index af6665122c..37031176a8 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -282,7 +282,7 @@ static void inavDraw() { } //auto-set HOME Point if (sats >= 6 && current<1) { //&& speed<2 && dist<2 && galt<2 - if(speed<2){ + if(speed<5 && dist<5){ inavSetHome(); audioEvent(AU_SPECIAL_SOUND_TICK); } From b958776c3029cdbff1dd25a564a1a91688e84f5d Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 14:51:48 -0400 Subject: [PATCH 31/99] v13 --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 37031176a8..f34f30d8c2 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -281,7 +281,7 @@ static void inavDraw() { audioEvent(AU_SPECIAL_SOUND_RATATA); } //auto-set HOME Point - if (sats >= 6 && current<1) { //&& speed<2 && dist<2 && galt<2 + if (sats >= 6 && current<20) { //current::mAh if(speed<5 && dist<5){ inavSetHome(); audioEvent(AU_SPECIAL_SOUND_TICK); From 5e976ae4171306ce9fd3bff3f4c936fde1d350eb Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 14:54:30 -0400 Subject: [PATCH 32/99] v14 --- radio/src/targets/flysky/tools/inav.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index f34f30d8c2..2e1befe7ad 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -276,6 +276,7 @@ static void inavDraw() { drawTelemetryTopBar(); // after rxBatt to add INVERS + if (sats >= 6 && inavData.homeLat == 0) { inavSetHome(); audioEvent(AU_SPECIAL_SOUND_RATATA); @@ -287,6 +288,9 @@ static void inavDraw() { audioEvent(AU_SPECIAL_SOUND_TICK); } } + //test + lcdDrawNumber(70, 30, current, SMLSIZE | RIGHT); + lcdDrawNumber(70, 20, dist, SMLSIZE | RIGHT); int32_t h = inavData.homeLat - inavData.currentLat; int32_t w = inavData.homeLon - inavData.currentLon; From f6845708170d96577aa557293bb8bc7a04307af2 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 15:01:20 -0400 Subject: [PATCH 33/99] v15 --- radio/src/targets/flysky/tools/inav.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 2e1befe7ad..932b7a70ce 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -275,22 +275,20 @@ static void inavDraw() { drawValueWithUnit(LCD_W - 6, 0, rxBatt, UNIT_VOLTS, PREC1 | RIGHT); drawTelemetryTopBar(); // after rxBatt to add INVERS - - if (sats >= 6 && inavData.homeLat == 0) { inavSetHome(); audioEvent(AU_SPECIAL_SOUND_RATATA); } //auto-set HOME Point - if (sats >= 6 && current<20) { //current::mAh + if (sats >= 6 && current<10) { //current Value==10*Amp if(speed<5 && dist<5){ inavSetHome(); audioEvent(AU_SPECIAL_SOUND_TICK); } } //test - lcdDrawNumber(70, 30, current, SMLSIZE | RIGHT); - lcdDrawNumber(70, 20, dist, SMLSIZE | RIGHT); + lcdDrawNumber(70, 30, speed, SMLSIZE | RIGHT); + lcdDrawNumber(70, 20, galt, SMLSIZE | RIGHT); int32_t h = inavData.homeLat - inavData.currentLat; int32_t w = inavData.homeLon - inavData.currentLon; From 8acb46b5873bc00f1b2594bf6fb665653a2404b9 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 15:02:36 -0400 Subject: [PATCH 34/99] v16 --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 932b7a70ce..ffafc550c3 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -79,7 +79,7 @@ static void inavSetHome() { inavData.homeLat = inavData.currentLat; inavData.homeLon = inavData.currentLon; // inavData.homeHeading = inavData.heading; - lcdDrawText(LCD_W/2-4 , LCD_H-10, "***", SMLSIZE);///indicator + lcdDrawText(LCD_W/2-4 , LCD_H-12, "***", SMLSIZE);///indicator } static void inavDrawHome(uint8_t x, uint8_t y) { From 3f104f3b34b4c328fe07ec3b8e2387fdfdba1979 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Thu, 16 May 2024 15:11:07 -0400 Subject: [PATCH 35/99] v17 --- radio/src/targets/flysky/tools/inav.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index ffafc550c3..4515323ec9 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -281,14 +281,14 @@ static void inavDraw() { } //auto-set HOME Point if (sats >= 6 && current<10) { //current Value==10*Amp - if(speed<5 && dist<5){ + if(speed<5 && dist<5 && galt<2){ //speed Value==10*KMH inavSetHome(); - audioEvent(AU_SPECIAL_SOUND_TICK); + //audioEvent(AU_SPECIAL_SOUND_TICK); } } //test - lcdDrawNumber(70, 30, speed, SMLSIZE | RIGHT); - lcdDrawNumber(70, 20, galt, SMLSIZE | RIGHT); + //lcdDrawNumber(70, 30, speed, SMLSIZE | RIGHT); + //lcdDrawNumber(70, 20, galt, SMLSIZE | RIGHT); int32_t h = inavData.homeLat - inavData.currentLat; int32_t w = inavData.homeLon - inavData.currentLon; From 43deaef409b647b6606d98b24d23bb5d323972ca Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 20:17:38 -0400 Subject: [PATCH 36/99] TXPW --- radio/src/targets/flysky/tools/inav.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 4515323ec9..d79a09556a 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -79,7 +79,7 @@ static void inavSetHome() { inavData.homeLat = inavData.currentLat; inavData.homeLon = inavData.currentLon; // inavData.homeHeading = inavData.heading; - lcdDrawText(LCD_W/2-4 , LCD_H-12, "***", SMLSIZE);///indicator + lcdDrawText(LCD_W/2-4 , LCD_H-14, "***", SMLSIZE);///indicator } static void inavDrawHome(uint8_t x, uint8_t y) { @@ -145,7 +145,7 @@ static void inavDraw() { // uint8_t rxBatt = 0, sats = 0; - int32_t dist = 0, alt = 0, galt = 0, speed = 0, current = 0; + int32_t dist = 0, alt = 0, galt = 0, speed = 0, current = 0, TXPW = 0; int8_t rssi = 0; int16_t vspd = 0; @@ -191,6 +191,8 @@ static void inavDraw() { } else if (strstr(sensor.label, ZSTR_GPS)) { // GPS coords inavData.currentLat = telemetryItem.gps.longitude; inavData.currentLon = telemetryItem.gps.latitude; + } else{ + TXPW=g_model.telemetrySensors[6];//[7-1]:ELRS TX Power } #endif // INAVLITE_CRSF } else if (telemetryProtocol == PROTOCOL_FLYSKY_IBUS) { @@ -259,6 +261,9 @@ static void inavDraw() { drawValueWithUnit(INAV_CURRENT_X, INAV_CURRENT_Y, current, UNIT_AMPS, PREC1 | MIDSIZE | RIGHT); + drawValueWithUnit(INAV_CURRENT_X, INAV_CURRENT_Y-10, TXPW, 'mW', MIDSIZE | RIGHT); + + drawValueWithUnit(LCD_W - 11, 53, rssi, UNIT_DB, MIDSIZE | RIGHT); drawValueWithUnit(INAV_GSPD_X, INAV_GSPD_Y, speed, UNIT_KMH, PREC1 | RIGHT); From 8d97884ebf6d438eeb5fc3e07047753a2c86f74c Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 20:20:35 -0400 Subject: [PATCH 37/99] UNIT_MILLIWATTS --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index d79a09556a..408479b19d 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -261,14 +261,14 @@ static void inavDraw() { drawValueWithUnit(INAV_CURRENT_X, INAV_CURRENT_Y, current, UNIT_AMPS, PREC1 | MIDSIZE | RIGHT); - drawValueWithUnit(INAV_CURRENT_X, INAV_CURRENT_Y-10, TXPW, 'mW', MIDSIZE | RIGHT); + drawValueWithUnit(INAV_CURRENT_X, INAV_CURRENT_Y-10, TXPW, UNIT_MILLIWATTS, MIDSIZE | RIGHT); drawValueWithUnit(LCD_W - 11, 53, rssi, UNIT_DB, MIDSIZE | RIGHT); drawValueWithUnit(INAV_GSPD_X, INAV_GSPD_Y, speed, UNIT_KMH, PREC1 | RIGHT); drawValueWithUnit(INAV_DIST_X, INAV_DIST_Y, dist, UNIT_METERS, 0); - drawValueWithUnit(INAV_ALT_X, INAV_ALT_Y, alt, UNIT_METERS, RIGHT); + //drawValueWithUnit(INAV_ALT_X, INAV_ALT_Y, alt, UNIT_METERS, RIGHT); lcdDrawChar(INAV_SATS_X - 25, INAV_SATS_Y + 4, SATS_ICON); lcdDrawNumber(INAV_SATS_X, INAV_SATS_Y, sats, MIDSIZE | RIGHT); From 51c28a31ff0a94d51b515d3ec7df17f0b9c61c4a Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 20:27:15 -0400 Subject: [PATCH 38/99] alt = telemetryItem.value;V2 --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 408479b19d..cd3eb06b43 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -191,8 +191,8 @@ static void inavDraw() { } else if (strstr(sensor.label, ZSTR_GPS)) { // GPS coords inavData.currentLat = telemetryItem.gps.longitude; inavData.currentLon = telemetryItem.gps.latitude; - } else{ - TXPW=g_model.telemetrySensors[6];//[7-1]:ELRS TX Power + } elseif(i==6){ + TXPW= telemetryItem.value;//[7-1]:ELRS TX Power } #endif // INAVLITE_CRSF } else if (telemetryProtocol == PROTOCOL_FLYSKY_IBUS) { From fc5afa1156534e1ce1bea879d5b6f1965f0816a0 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 20:28:34 -0400 Subject: [PATCH 39/99] elsfif --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index cd3eb06b43..7d7c450e09 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -191,7 +191,7 @@ static void inavDraw() { } else if (strstr(sensor.label, ZSTR_GPS)) { // GPS coords inavData.currentLat = telemetryItem.gps.longitude; inavData.currentLon = telemetryItem.gps.latitude; - } elseif(i==6){ + } else if(i==6){ TXPW= telemetryItem.value;//[7-1]:ELRS TX Power } #endif // INAVLITE_CRSF From eff1f7b2476b1d089e92e69bcf5fa6826dbebe43 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 20:49:48 -0400 Subject: [PATCH 40/99] v18 --- radio/src/targets/flysky/tools/inav.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 7d7c450e09..9c4c9d065e 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -260,19 +260,17 @@ static void inavDraw() { // lcdDrawNumber(LCD_W, INAV_SATS_Y + 21, (9 - (sats % 10)) * 5 + 8, PREC1 | MIDSIZE | RIGHT); drawValueWithUnit(INAV_CURRENT_X, INAV_CURRENT_Y, current, UNIT_AMPS, PREC1 | MIDSIZE | RIGHT); - - drawValueWithUnit(INAV_CURRENT_X, INAV_CURRENT_Y-10, TXPW, UNIT_MILLIWATTS, MIDSIZE | RIGHT); - + drawValueWithUnit(INAV_CURRENT_X-8, INAV_CURRENT_Y-15, TXPW, UNIT_MILLIWATTS, MIDSIZE | RIGHT); drawValueWithUnit(LCD_W - 11, 53, rssi, UNIT_DB, MIDSIZE | RIGHT); drawValueWithUnit(INAV_GSPD_X, INAV_GSPD_Y, speed, UNIT_KMH, PREC1 | RIGHT); drawValueWithUnit(INAV_DIST_X, INAV_DIST_Y, dist, UNIT_METERS, 0); - //drawValueWithUnit(INAV_ALT_X, INAV_ALT_Y, alt, UNIT_METERS, RIGHT); + drawValueWithUnit(INAV_ALT_X, INAV_ALT_Y, alt, UNIT_METERS, RIGHT); lcdDrawChar(INAV_SATS_X - 25, INAV_SATS_Y + 4, SATS_ICON); lcdDrawNumber(INAV_SATS_X, INAV_SATS_Y, sats, MIDSIZE | RIGHT); - drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, galt, UNIT_METERS, RIGHT); + //drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, galt, UNIT_METERS, RIGHT); // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); @@ -286,7 +284,7 @@ static void inavDraw() { } //auto-set HOME Point if (sats >= 6 && current<10) { //current Value==10*Amp - if(speed<5 && dist<5 && galt<2){ //speed Value==10*KMH + if(speed<5 && dist<5 && galt<5 && alt<5){ //speed Value==10*KMH inavSetHome(); //audioEvent(AU_SPECIAL_SOUND_TICK); } From 9fef78305b97bc1a28988093c78839dc66977222 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 20:58:57 -0400 Subject: [PATCH 41/99] v19 --- radio/src/targets/flysky/tools/inav.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 9c4c9d065e..dc32f1ac0f 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -265,12 +265,14 @@ static void inavDraw() { drawValueWithUnit(LCD_W - 11, 53, rssi, UNIT_DB, MIDSIZE | RIGHT); drawValueWithUnit(INAV_GSPD_X, INAV_GSPD_Y, speed, UNIT_KMH, PREC1 | RIGHT); - drawValueWithUnit(INAV_DIST_X, INAV_DIST_Y, dist, UNIT_METERS, 0); - drawValueWithUnit(INAV_ALT_X, INAV_ALT_Y, alt, UNIT_METERS, RIGHT); +// drawValueWithUnit(INAV_DIST_X, INAV_DIST_Y, dist, UNIT_METERS, 0); +// drawValueWithUnit(INAV_ALT_X, INAV_ALT_Y, galt, UNIT_METERS, RIGHT); lcdDrawChar(INAV_SATS_X - 25, INAV_SATS_Y + 4, SATS_ICON); lcdDrawNumber(INAV_SATS_X, INAV_SATS_Y, sats, MIDSIZE | RIGHT); - //drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, galt, UNIT_METERS, RIGHT); + + drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); + drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y-11, dist, UNIT_METERS, 0); // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); From b7ed21cdb373c33851e1de06a7a69cbd1af9cc24 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:02:42 -0400 Subject: [PATCH 42/99] v20 --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index dc32f1ac0f..df59424013 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -272,7 +272,7 @@ static void inavDraw() { lcdDrawNumber(INAV_SATS_X, INAV_SATS_Y, sats, MIDSIZE | RIGHT); drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y-11, dist, UNIT_METERS, 0); + drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-11, dist, UNIT_METERS, 0); // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); From 8dcdece2f10bb63c000a3c95c924584ef8c0c069 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:07:20 -0400 Subject: [PATCH 43/99] v21 --- radio/src/targets/flysky/tools/inav.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index df59424013..1b1156f2b0 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -270,9 +270,13 @@ static void inavDraw() { lcdDrawChar(INAV_SATS_X - 25, INAV_SATS_Y + 4, SATS_ICON); lcdDrawNumber(INAV_SATS_X, INAV_SATS_Y, sats, MIDSIZE | RIGHT); - + + drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-11, dist, UNIT_METERS, 0); + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, 'Alt.'); + + drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Dist.'); // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); From b9e64a12a1b6f40bcff0f3bc1b85265788914d63 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:09:09 -0400 Subject: [PATCH 44/99] v22 --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 1b1156f2b0..cb1f1cd47f 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,10 +273,10 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, 'Alt.'); + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, 'Alt'); drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Dist.'); + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Dist'); // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); From 1a6fb67053b68e9ae04d2ec93087722fb773844e Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:12:17 -0400 Subject: [PATCH 45/99] v23 --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index cb1f1cd47f..a87ebabd5c 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,10 +273,10 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, 'Alt'); + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, 'Alt*'); drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Dist'); + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Dist*'); // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); From 15de75382c1679c469c82e6686954089ea1d98da Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:14:28 -0400 Subject: [PATCH 46/99] v24 --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index a87ebabd5c..22e7384f5e 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,10 +273,10 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, 'Alt*'); + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, 'Alitute'); drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Dist*'); + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); From 1c4d81de3baff028fd348defe3d8b35dcca10b58 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:17:12 -0400 Subject: [PATCH 47/99] v25 --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 22e7384f5e..526ca619e2 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,10 +273,10 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, 'Alitute'); + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}); drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); + //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); From 76f15058f9f64a1f911eee273177cbb692110d54 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:20:26 -0400 Subject: [PATCH 48/99] v26 --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 526ca619e2..455d0008c8 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,7 +273,7 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}); + lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3, MIDSIZE) drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); From c06178f3c456c4e1f5b940c55c1f7d12d91251c6 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:21:19 -0400 Subject: [PATCH 49/99] v27 --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 455d0008c8..0c49eeb3e1 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,7 +273,7 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3, MIDSIZE) + lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3) drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); From ef0ac2c14b41e1e5d62de538702e442227356cce Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:23:09 -0400 Subject: [PATCH 50/99] SMLSIZE | CENTERED --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 0c49eeb3e1..8daacede49 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,7 +273,7 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3) + lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3, SMLSIZE | CENTERED) drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); From e3ca3a6333a5d0594e88210066229e86538dad92 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:25:16 -0400 Subject: [PATCH 51/99] ;; --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 8daacede49..5816415ead 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,7 +273,7 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3, SMLSIZE | CENTERED) + lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3, SMLSIZE | CENTERED); drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); From 6ab831c5d7afe99aa22e1387ea229a0c681c3753 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:26:11 -0400 Subject: [PATCH 52/99] -- --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 5816415ead..d75211dc37 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,7 +273,7 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3, SMLSIZE | CENTERED); + lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3, SMLSIZE); drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); From 55db29291c55d1f082c3191c6fc97da4a5e3c590 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:27:10 -0400 Subject: [PATCH 53/99] rr --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index d75211dc37..98ffc6fdfe 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,7 +273,7 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3, SMLSIZE); + lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3); drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); From 02335f747e22585bd4cfb7bec75b51f2c50cd1a0 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:28:41 -0400 Subject: [PATCH 54/99] {} --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 98ffc6fdfe..82556644a7 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,7 +273,7 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11, {'A','L','T'}, 3); + lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11,{{'A','L','T'}}, 3); drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); From 1578ae202d3762dc6517989f5658eab14ae8be6f Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:30:29 -0400 Subject: [PATCH 55/99] *** --- radio/src/targets/flysky/tools/inav.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 82556644a7..d123c45b4c 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,7 +273,8 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawSizedText(INAV_GALT_X-25, INAV_GALT_Y-11,{{'A','L','T'}}, 3); + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, "***", SMLSIZE);///indicator + drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); From c65b69b413475ee4e4e07e4b13494057638243a1 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:31:21 -0400 Subject: [PATCH 56/99] "" --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index d123c45b4c..f89b34c3cc 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -273,7 +273,7 @@ static void inavDraw() { drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, "***", SMLSIZE);///indicator + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, "ALT", SMLSIZE);///indicator drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); From e0b055fca1fbe868f759450cd42ffc76aed6adab Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:32:09 -0400 Subject: [PATCH 57/99] v30 --- radio/src/targets/flysky/tools/inav.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index f89b34c3cc..db2fba16a7 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -271,12 +271,11 @@ static void inavDraw() { lcdDrawChar(INAV_SATS_X - 25, INAV_SATS_Y + 4, SATS_ICON); lcdDrawNumber(INAV_SATS_X, INAV_SATS_Y, sats, MIDSIZE | RIGHT); - drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, "ALT", SMLSIZE);///indicator - + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, "Alt.", SMLSIZE);///indicator drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); + lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, "Dist.", SMLSIZE);///indicator //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); From 64057ad24ac7b4fb5dcb66fa2b9d6b2e2b5f0b43 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:36:08 -0400 Subject: [PATCH 58/99] v31 --- radio/src/targets/flysky/tools/inav.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index db2fba16a7..10c49034d2 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -272,10 +272,10 @@ static void inavDraw() { lcdDrawNumber(INAV_SATS_X, INAV_SATS_Y, sats, MIDSIZE | RIGHT); drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-11, "Alt.", SMLSIZE);///indicator + lcdDrawText(INAV_GALT_X-19, INAV_GALT_Y, "Alt.", SMLSIZE);///indicator - drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-22, dist, UNIT_METERS, 0); - lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, "Dist.", SMLSIZE);///indicator + drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-12, dist, UNIT_METERS, 0); + lcdDrawText(INAV_GALT_X-19, INAV_GALT_Y-23, "Dist.", SMLSIZE);///indicator //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); From 53edd520908b3f9ff1f763f5164b8ea05da32d16 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:40:05 -0400 Subject: [PATCH 59/99] v32 --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 10c49034d2..dd7a091240 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -272,9 +272,9 @@ static void inavDraw() { lcdDrawNumber(INAV_SATS_X, INAV_SATS_Y, sats, MIDSIZE | RIGHT); drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - lcdDrawText(INAV_GALT_X-19, INAV_GALT_Y, "Alt.", SMLSIZE);///indicator + lcdDrawText(INAV_GALT_X-19, INAV_GALT_Y-7, "Alt.", SMLSIZE);///indicator - drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-12, dist, UNIT_METERS, 0); + drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-5, dist, UNIT_METERS, 0); lcdDrawText(INAV_GALT_X-19, INAV_GALT_Y-23, "Dist.", SMLSIZE);///indicator //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); From 02b9a9585dc081f2810972374d8207803d85c0e4 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Sun, 19 May 2024 21:50:42 -0400 Subject: [PATCH 60/99] v34 --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index dd7a091240..607579ad82 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -271,11 +271,11 @@ static void inavDraw() { lcdDrawChar(INAV_SATS_X - 25, INAV_SATS_Y + 4, SATS_ICON); lcdDrawNumber(INAV_SATS_X, INAV_SATS_Y, sats, MIDSIZE | RIGHT); - drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); lcdDrawText(INAV_GALT_X-19, INAV_GALT_Y-7, "Alt.", SMLSIZE);///indicator + drawValueWithUnit(INAV_GALT_X, INAV_GALT_Y, alt, UNIT_METERS, RIGHT); - drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-5, dist, UNIT_METERS, 0); lcdDrawText(INAV_GALT_X-19, INAV_GALT_Y-23, "Dist.", SMLSIZE);///indicator + drawValueWithUnit(INAV_GALT_X-5, INAV_GALT_Y-15, dist, UNIT_METERS, 0); //lcdDrawText(INAV_GALT_X-25, INAV_GALT_Y-33, 'Distance'); // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); From ee4e6bed99662712c2738db54edcc0ad66c9da50 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 14:48:01 -0400 Subject: [PATCH 61/99] MapSign --- radio/src/targets/flysky/tools/inav.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 607579ad82..5bcb87eb19 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -60,6 +60,7 @@ struct InavData { int32_t currentLon; // uint8_t homeHeading; uint8_t heading; + uint8_t MapSign=1;//(+):north up|(-):north down }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; From 09767ea4d17d2408c4e17e640f525fc63b178e45 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 14:53:30 -0400 Subject: [PATCH 62/99] KEY_DOWN --- radio/src/targets/flysky/tools/inav.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 5bcb87eb19..44926b2c82 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -348,6 +348,9 @@ void inavRun(event_t event) { } else if (event == EVT_KEY_LONG(KEY_ENTER)) { // set home on long press OK inavSetHome(); audioEvent(AU_SPECIAL_SOUND_WARN2); + } else if (event == EVT_KEY_LONG(KEY_DOWN)) { // set home on long press Down + audioEvent(AU_SPECIAL_SOUND_TADA); + InavData.MapSign=InavData.MapSign*-1;//rotating the map 180 deg. } inavDraw(); From 80773d1a878d7057b74fb32508de67a345d2c6c3 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 14:56:23 -0400 Subject: [PATCH 63/99] constexpr int8_t --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 44926b2c82..8982bcecf0 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -60,7 +60,7 @@ struct InavData { int32_t currentLon; // uint8_t homeHeading; uint8_t heading; - uint8_t MapSign=1;//(+):north up|(-):north down + constexpr int8_t MapSign=1;//(+):north up|(-):north down }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; From b93401781a19dc1c05ff754832b28b773c1b5e0e Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 14:58:54 -0400 Subject: [PATCH 64/99] InavData --- radio/src/targets/flysky/tools/inav.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 8982bcecf0..62cac17751 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -60,7 +60,8 @@ struct InavData { int32_t currentLon; // uint8_t homeHeading; uint8_t heading; - constexpr int8_t MapSign=1;//(+):north up|(-):north down + constexpr int8_t MapPSign=1;//(+):north up|(-):north down + constexpr int8_t MapNSign=-1; }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; @@ -350,7 +351,7 @@ void inavRun(event_t event) { audioEvent(AU_SPECIAL_SOUND_WARN2); } else if (event == EVT_KEY_LONG(KEY_DOWN)) { // set home on long press Down audioEvent(AU_SPECIAL_SOUND_TADA); - InavData.MapSign=InavData.MapSign*-1;//rotating the map 180 deg. + InavData.MapSign=InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. } inavDraw(); From 18cefe10c6913c22eab2a60b6cac3e4deb48507c Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 14:59:36 -0400 Subject: [PATCH 65/99] MapPSign --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 62cac17751..0d3497c8ba 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -351,7 +351,7 @@ void inavRun(event_t event) { audioEvent(AU_SPECIAL_SOUND_WARN2); } else if (event == EVT_KEY_LONG(KEY_DOWN)) { // set home on long press Down audioEvent(AU_SPECIAL_SOUND_TADA); - InavData.MapSign=InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. + InavData.MapPSign=InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. } inavDraw(); From 0dc7713bb93cc3a21d4f537bbf35a899e051007d Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:00:27 -0400 Subject: [PATCH 66/99] int8_t --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 0d3497c8ba..b68c103408 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -60,8 +60,8 @@ struct InavData { int32_t currentLon; // uint8_t homeHeading; uint8_t heading; - constexpr int8_t MapPSign=1;//(+):north up|(-):north down - constexpr int8_t MapNSign=-1; + int8_t MapPSign=1;//(+):north up|(-):north down + int8_t MapNSign=-1; }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; From b41d67b3c273dde55ef54d0ed932994574fd1258 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:02:55 -0400 Subject: [PATCH 67/99] inavSetMapN --- radio/src/targets/flysky/tools/inav.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index b68c103408..ed2934c91a 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -84,6 +84,10 @@ static void inavSetHome() { lcdDrawText(LCD_W/2-4 , LCD_H-14, "***", SMLSIZE);///indicator } +static void inavSetMapN() { + InavData.MapPSign=InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. +} + static void inavDrawHome(uint8_t x, uint8_t y) { lcdDrawChar(x - 2, y - 3, HOME_ICON); } @@ -351,7 +355,7 @@ void inavRun(event_t event) { audioEvent(AU_SPECIAL_SOUND_WARN2); } else if (event == EVT_KEY_LONG(KEY_DOWN)) { // set home on long press Down audioEvent(AU_SPECIAL_SOUND_TADA); - InavData.MapPSign=InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. + inavSetMapN(); } inavDraw(); From 9a4f21a12b6c1688a18010b810fe9ca2492fd9d0 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:05:12 -0400 Subject: [PATCH 68/99] t1 --- radio/src/targets/flysky/tools/inav.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index ed2934c91a..4843b5d900 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -85,7 +85,7 @@ static void inavSetHome() { } static void inavSetMapN() { - InavData.MapPSign=InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. + InavData.MapPSign=1;//InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. } static void inavDrawHome(uint8_t x, uint8_t y) { @@ -353,9 +353,9 @@ void inavRun(event_t event) { } else if (event == EVT_KEY_LONG(KEY_ENTER)) { // set home on long press OK inavSetHome(); audioEvent(AU_SPECIAL_SOUND_WARN2); - } else if (event == EVT_KEY_LONG(KEY_DOWN)) { // set home on long press Down - audioEvent(AU_SPECIAL_SOUND_TADA); + } else if (event == EVT_KEY_LONG(KEY_DOWN)) { // set home on long press Down inavSetMapN(); + audioEvent(AU_SPECIAL_SOUND_TADA); } inavDraw(); From 6ce444a86c8dac9efb17b4aba3924752df8bc2b2 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:07:17 -0400 Subject: [PATCH 69/99] uint8_t --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 4843b5d900..04ed4e34ae 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -60,8 +60,8 @@ struct InavData { int32_t currentLon; // uint8_t homeHeading; uint8_t heading; - int8_t MapPSign=1;//(+):north up|(-):north down - int8_t MapNSign=-1; + uint8_t MapPSign=1;//(+):north up|(-):north down + uint8_t MapNSign=-1; }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; From c2e642e38190988bbe0d9de14ee1bbe8d6a4da26 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:09:16 -0400 Subject: [PATCH 70/99] MapNSign --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 04ed4e34ae..32bc37b36e 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -61,7 +61,7 @@ struct InavData { // uint8_t homeHeading; uint8_t heading; uint8_t MapPSign=1;//(+):north up|(-):north down - uint8_t MapNSign=-1; + uint8_t MapNSign=1; }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; From 450e3e8c93fd9c9384d0a34af9f43549d6727937 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:12:03 -0400 Subject: [PATCH 71/99] sine[32] --- radio/src/targets/flysky/tools/inav.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 32bc37b36e..375684d950 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -60,8 +60,8 @@ struct InavData { int32_t currentLon; // uint8_t homeHeading; uint8_t heading; - uint8_t MapPSign=1;//(+):north up|(-):north down - uint8_t MapNSign=1; + int8_t MapPSign=1;//(+):north up|(-):north down + int8_t MapNSign=1; }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; @@ -85,7 +85,7 @@ static void inavSetHome() { } static void inavSetMapN() { - InavData.MapPSign=1;//InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. + InavData.MapPSign = sine[32];//InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. } static void inavDrawHome(uint8_t x, uint8_t y) { From 8e950a720b71c2af4c812d8fda55f2e17832a86c Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:13:12 -0400 Subject: [PATCH 72/99] // --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 375684d950..01ecd7ecc2 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -85,7 +85,7 @@ static void inavSetHome() { } static void inavSetMapN() { - InavData.MapPSign = sine[32];//InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. + /// InavData.MapPSign = sine[32];//InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. } static void inavDrawHome(uint8_t x, uint8_t y) { From b7a88e46d40c57a9e1b11e0f0ed5cddb7e4b512d Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:14:13 -0400 Subject: [PATCH 73/99] -1 --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 01ecd7ecc2..69b518d966 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -61,7 +61,7 @@ struct InavData { // uint8_t homeHeading; uint8_t heading; int8_t MapPSign=1;//(+):north up|(-):north down - int8_t MapNSign=1; + int8_t MapNSign=-1; }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; From af72a38cf3345246ae10b95f3ba6801f2f5bf2da Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:15:40 -0400 Subject: [PATCH 74/99] inavData.MapPSign --- radio/src/targets/flysky/tools/inav.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 69b518d966..5302c36d2c 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -61,7 +61,6 @@ struct InavData { // uint8_t homeHeading; uint8_t heading; int8_t MapPSign=1;//(+):north up|(-):north down - int8_t MapNSign=-1; }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; @@ -85,7 +84,7 @@ static void inavSetHome() { } static void inavSetMapN() { - /// InavData.MapPSign = sine[32];//InavData.MapPSign*InavData.MapNSign;//rotating the map 180 deg. + inavData.MapPSign = inavData.MapPSign*-1;//rotating the map 180 deg. } static void inavDrawHome(uint8_t x, uint8_t y) { From 9b175ef5b72bbc7b60ef088c42abbd78198fd724 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:19:11 -0400 Subject: [PATCH 75/99] S&W --- radio/src/targets/flysky/tools/inav.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 5302c36d2c..08db89a16c 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -145,8 +145,13 @@ static void inavDraw() { lcdDrawLine(LCD_W - 30, (LCD_H / 2) + FH / 2, LCD_W - 28, (LCD_H / 2) + FH / 2, DOTTED, FORCE); //MAP-Direction-Legend +if (inavData.MapPSign==1){ //positive N up lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE); lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE); +}else{//negative north down: 180deg rotation + lcdDrawText(LCD_W - 37, LCD_H/2, "W", SMLSIZE); + lcdDrawText(LCD_W/2-1 , LCD_H-6, "N", SMLSIZE); +} // uint8_t rxBatt = 0, sats = 0; From d751a9fa614ee09f8a153eeabd70113b114f4fb2 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:27:29 -0400 Subject: [PATCH 76/99] H&A --- radio/src/targets/flysky/tools/inav.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 08db89a16c..9daa190437 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -147,10 +147,10 @@ static void inavDraw() { //MAP-Direction-Legend if (inavData.MapPSign==1){ //positive N up lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE); - lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE); + lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down }else{//negative north down: 180deg rotation lcdDrawText(LCD_W - 37, LCD_H/2, "W", SMLSIZE); - lcdDrawText(LCD_W/2-1 , LCD_H-6, "N", SMLSIZE); + lcdDrawText(LCD_W/2-1 , LCD_H-6, "N", SMLSIZE);//down } // @@ -328,11 +328,11 @@ if (inavData.MapPSign==1){ //positive N up // rotate to homeHeading // ... - // scale - int8_t scaledHomeLon = translatedHomeLon / scaleFactor; - int8_t scaledHomeLat = translatedHomeLat / scaleFactor; - int8_t scaledCurrentLon = translatedCurrentLon / scaleFactor; - int8_t scaledCurrentLat = translatedCurrentLat / scaleFactor; + // scale:: //considering the North Position::inavData.MapPSign + int8_t scaledHomeLon = inavData.MapPSign* translatedHomeLon / scaleFactor; + int8_t scaledHomeLat = inavData.MapPSign* translatedHomeLat / scaleFactor; + int8_t scaledCurrentLon = inavData.MapPSign* translatedCurrentLon / scaleFactor; + int8_t scaledCurrentLat = inavData.MapPSign* translatedCurrentLat / scaleFactor; // translate to LCD center space and draw From 05dabcd0deade9c0bd2ea4940e3b12140bb3140d Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:36:16 -0400 Subject: [PATCH 77/99] >0 --- radio/src/targets/flysky/tools/inav.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 9daa190437..20f6eae91e 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -60,7 +60,7 @@ struct InavData { int32_t currentLon; // uint8_t homeHeading; uint8_t heading; - int8_t MapPSign=1;//(+):north up|(-):north down + int8_t MapPSign=1;//default (+):north up|(-):north down }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; @@ -145,7 +145,7 @@ static void inavDraw() { lcdDrawLine(LCD_W - 30, (LCD_H / 2) + FH / 2, LCD_W - 28, (LCD_H / 2) + FH / 2, DOTTED, FORCE); //MAP-Direction-Legend -if (inavData.MapPSign==1){ //positive N up +if (inavData.MapPSign>0){ //positive N up lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE); lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down }else{//negative north down: 180deg rotation @@ -357,7 +357,7 @@ void inavRun(event_t event) { } else if (event == EVT_KEY_LONG(KEY_ENTER)) { // set home on long press OK inavSetHome(); audioEvent(AU_SPECIAL_SOUND_WARN2); - } else if (event == EVT_KEY_LONG(KEY_DOWN)) { // set home on long press Down + } else if (event == EVT_KEY_FIRST(KEY_MENU)) { // set home on press menu inavSetMapN(); audioEvent(AU_SPECIAL_SOUND_TADA); } From 983f30c3f193e202a0d9c07014fdf405954620ff Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:48:42 -0400 Subject: [PATCH 78/99] *= --- radio/src/targets/flysky/tools/inav.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 20f6eae91e..c0f7e4f088 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -60,7 +60,7 @@ struct InavData { int32_t currentLon; // uint8_t homeHeading; uint8_t heading; - int8_t MapPSign=1;//default (+):north up|(-):north down + int8_t MapPSign = 1;//default (+):north up|(-):north down }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; @@ -84,7 +84,7 @@ static void inavSetHome() { } static void inavSetMapN() { - inavData.MapPSign = inavData.MapPSign*-1;//rotating the map 180 deg. + inavData.MapPSign *= -1;//rotating the map 180 deg. } static void inavDrawHome(uint8_t x, uint8_t y) { @@ -357,7 +357,7 @@ void inavRun(event_t event) { } else if (event == EVT_KEY_LONG(KEY_ENTER)) { // set home on long press OK inavSetHome(); audioEvent(AU_SPECIAL_SOUND_WARN2); - } else if (event == EVT_KEY_FIRST(KEY_MENU)) { // set home on press menu + } else if (event == EVT_KEY_LONG(KEY_PGUP)) { // set home on press menu inavSetMapN(); audioEvent(AU_SPECIAL_SOUND_TADA); } From 9ff04efdac4a75de1dfdcbba34b97729e314ff8e Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:50:32 -0400 Subject: [PATCH 79/99] KEY_RIGHT --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index c0f7e4f088..71e6f5878f 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -357,7 +357,7 @@ void inavRun(event_t event) { } else if (event == EVT_KEY_LONG(KEY_ENTER)) { // set home on long press OK inavSetHome(); audioEvent(AU_SPECIAL_SOUND_WARN2); - } else if (event == EVT_KEY_LONG(KEY_PGUP)) { // set home on press menu + } else if (event == EVT_KEY_LONG(KEY_RIGHT)) { // set home on press menu inavSetMapN(); audioEvent(AU_SPECIAL_SOUND_TADA); } From 2115f6e76013257852e6be67b413d868da6dcc53 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:53:02 -0400 Subject: [PATCH 80/99] >=0 --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 71e6f5878f..7efe8a1426 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -145,7 +145,7 @@ static void inavDraw() { lcdDrawLine(LCD_W - 30, (LCD_H / 2) + FH / 2, LCD_W - 28, (LCD_H / 2) + FH / 2, DOTTED, FORCE); //MAP-Direction-Legend -if (inavData.MapPSign>0){ //positive N up +if (inavData.MapPSign>=0){ //positive N up lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE); lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down }else{//negative north down: 180deg rotation From 1d9d911d19ca89c83db517f590207e92cff04b7b Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:56:47 -0400 Subject: [PATCH 81/99] else{ --- radio/src/targets/flysky/tools/inav.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 7efe8a1426..f1b2fac2b6 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -60,7 +60,7 @@ struct InavData { int32_t currentLon; // uint8_t homeHeading; uint8_t heading; - int8_t MapPSign = 1;//default (+):north up|(-):north down + int8_t MapPSign;//default (+):north up|(-):north down }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; @@ -145,12 +145,14 @@ static void inavDraw() { lcdDrawLine(LCD_W - 30, (LCD_H / 2) + FH / 2, LCD_W - 28, (LCD_H / 2) + FH / 2, DOTTED, FORCE); //MAP-Direction-Legend -if (inavData.MapPSign>=0){ //positive N up +if (inavData.MapPSign>0){ //positive N up lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE); lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down -}else{//negative north down: 180deg rotation +}else (inavData.MapPSign<0){//negative north down: 180deg rotation lcdDrawText(LCD_W - 37, LCD_H/2, "W", SMLSIZE); lcdDrawText(LCD_W/2-1 , LCD_H-6, "N", SMLSIZE);//down +}else{ + inavData.MapPSign=1; } // From 6fefdfa111756a451e9f5e4968df12e5cf50e507 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:57:42 -0400 Subject: [PATCH 82/99] inititial value --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index f1b2fac2b6..1a64d45bd9 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -148,10 +148,10 @@ static void inavDraw() { if (inavData.MapPSign>0){ //positive N up lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE); lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down -}else (inavData.MapPSign<0){//negative north down: 180deg rotation +}elseif(inavData.MapPSign<0){//negative north down: 180deg rotation lcdDrawText(LCD_W - 37, LCD_H/2, "W", SMLSIZE); lcdDrawText(LCD_W/2-1 , LCD_H-6, "N", SMLSIZE);//down -}else{ +}else{//inititial value inavData.MapPSign=1; } // From 8e498eaf4fce0673211ecc7a8c79c269db95a230 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 15:57:58 -0400 Subject: [PATCH 83/99] else if --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 1a64d45bd9..5fac38af14 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -148,7 +148,7 @@ static void inavDraw() { if (inavData.MapPSign>0){ //positive N up lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE); lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down -}elseif(inavData.MapPSign<0){//negative north down: 180deg rotation +}else if(inavData.MapPSign<0){//negative north down: 180deg rotation lcdDrawText(LCD_W - 37, LCD_H/2, "W", SMLSIZE); lcdDrawText(LCD_W/2-1 , LCD_H-6, "N", SMLSIZE);//down }else{//inititial value From d347bb61a739f1f5e9723192e51e77d6e40303f8 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 16:18:08 -0400 Subject: [PATCH 84/99] anestorov updates --- radio/src/targets/flysky/tools/inav.cpp | 62 +++++++++++++++++++------ 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 5fac38af14..53b2230b51 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -14,6 +14,9 @@ static const int8_t sine[32] = { 0,-25,-49,-71,-91,-107,-118,-126,-128,-126,-118,-107,-91,-71,-49,-25 }; +#define INAV_ARM_X 18 +#define INAV_ARM_Y 9 + #define INAV_BATTP_X 30 #define INAV_BATTP_Y 9 #define INAV_VOLT_X LCD_W @@ -61,6 +64,9 @@ struct InavData { // uint8_t homeHeading; uint8_t heading; int8_t MapPSign;//default (+):north up|(-):north down + + uint8_t armed = 1; + uint8_t lastMode = 0; }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; @@ -118,22 +124,27 @@ static void inavDrawCraft(uint8_t x, uint8_t y) { lcdDrawLine(tPLX, tPLY, tPRX, tPRY, DOTTED, FORCE); } -// Mode: 0 - Passthrough, 1-Armed(rate), 2-Horizon, 3-Angle, 4-Waypoint, 5-AltHold, 6-PosHold, 7-Rth, 8-Launch, 9-Failsafe +//FM2 5-MANUAL, 1-ACRO, 1-AIR, 0-ANGLE, 7-HRZN, 2-ALTHOLD, 8-POSHOLD, 6-RTH, 3-WP, 3-CRUISE, 4-LAUNCH, 9-FAILSAFE static void inavDrawAFHDS2AFM(uint8_t mode) { - static const char modeText[10][8] = { - {'P','A','S','S','T','H','R','U'}, - {'A','R','M','E','D','\0',' ',' '}, - {'H','O','R','I','Z','O','N','\0'}, - {'A','N','G','L','E','\0',' ',' '}, - {'W','A','Y','P','O','I','N','T'}, - {'A','L','T',' ','H','O','L','D'}, - {'P','O','S',' ','H','O','L','D'}, - {'R','T','H','\0',' ',' ',' ',' '}, - {'L','A','U','N','C','H','\0',' '}, - {'F','A','I','L','S','A','F','E'}, + static const char modeText[10][9] = { + {'A','N','G','L','E','\0',' ',' ',' '}, + {'A','C','R','O',' ','A','I','R','\0'}, + {'A','L','T',' ','H','O','L','D','\0'}, + {'W','P',' ','C','R','U','I','S', 'E'}, + {'L','A','U','N','C','H','\0',' ',' '}, + {'M','A','N','U','E','L','\0',' ',' '}, + {'R','T','H','\0',' ',' ',' ',' ',' '}, + {'H','O','R','I','Z','O','N','\0',' '}, + {'P','O','S',' ','H','O','L','D','\0'}, + {'F','A','I','L','S','A','F','E','\0'}, }; - lcdDrawSizedText(INAV_FM_X, INAV_FM_Y, modeText[mode], 8, SMLSIZE | CENTERED); + lcdDrawSizedText(INAV_FM_X, INAV_FM_Y, modeText[mode], 9, SMLSIZE | CENTERED); + + if(inavData.lastMode != mode) { + audioEvent(AU_SPECIAL_SOUND_WARN2); + } + inavData.lastMode = mode; } static void inavDraw() { @@ -212,6 +223,11 @@ if (inavData.MapPSign>0){ //positive N up if (g_model.telemetrySensors[i].id == 0xfc) { // RX RSSI rssi = telemetryItem.value; } + + if (g_model.telemetrySensors[i].id == 0x80) { // GPS + inavData.currentLat = telemetryItem.gps.latitude; + inavData.currentLon = telemetryItem.gps.longitude; + } switch(g_model.telemetrySensors[i].instance) { // inav index - 1 case 1: // voltage sensor @@ -237,8 +253,17 @@ if (inavData.MapPSign>0){ //positive N up case 8: // 9. Dist dist = telemetryItem.value; break; - // case 9: // 10. Armed - // break; + case 9: // 10. Armed + if(telemetryItem.value != inavData.armed) { + if(telemetryItem.value == 0) { + inavData.homeLat = 0; + inavData.homeLon = 0; + } else { + audioEvent(AU_SPECIAL_SOUND_SIREN); + } + } + inavData.armed = telemetryItem.value; + break; case 10: // 11. Speed speed = telemetryItem.value; break; @@ -292,6 +317,13 @@ if (inavData.MapPSign>0){ //positive N up // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); + lcdDrawNumber(INAV_SATS_X-8, INAV_SATS_Y + 18, vspd, SMLSIZE | RIGHT); + + static const char armText[2][5] = { + {'A', 'R', 'M', 'E', 'D'}, + {'O', 'F', 'F', '\0', ' '}, + }; + lcdDrawSizedText(INAV_ARM_X, INAV_ARM_Y, armText[inavData.armed], 5, SMLSIZE | CENTERED); drawValueWithUnit(LCD_W - 6, 0, rxBatt, UNIT_VOLTS, PREC1 | RIGHT); drawTelemetryTopBar(); // after rxBatt to add INVERS From 4ee786ff2716ee8fbaf657bf6ed24b8e6ea1b740 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 16:30:11 -0400 Subject: [PATCH 85/99] INAV_DIST_Y --- radio/src/targets/flysky/tools/inav.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 53b2230b51..f31abb49fe 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -14,8 +14,8 @@ static const int8_t sine[32] = { 0,-25,-49,-71,-91,-107,-118,-126,-128,-126,-118,-107,-91,-71,-49,-25 }; -#define INAV_ARM_X 18 -#define INAV_ARM_Y 9 +//#define INAV_ARM_X 18 +//#define INAV_ARM_Y 9 #define INAV_BATTP_X 30 #define INAV_BATTP_Y 9 @@ -63,8 +63,7 @@ struct InavData { int32_t currentLon; // uint8_t homeHeading; uint8_t heading; - int8_t MapPSign;//default (+):north up|(-):north down - + int8_t MapPSign;//default (+):north up|(-):north down uint8_t armed = 1; uint8_t lastMode = 0; }; @@ -319,11 +318,11 @@ if (inavData.MapPSign>0){ //positive N up // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); lcdDrawNumber(INAV_SATS_X-8, INAV_SATS_Y + 18, vspd, SMLSIZE | RIGHT); - static const char armText[2][5] = { - {'A', 'R', 'M', 'E', 'D'}, + static const char armText[2][5] = { {'O', 'F', 'F', '\0', ' '}, + {'A', 'R', 'M', 'E', 'D'} }; - lcdDrawSizedText(INAV_ARM_X, INAV_ARM_Y, armText[inavData.armed], 5, SMLSIZE | CENTERED); + lcdDrawSizedText(INAV_DIST_X, INAV_DIST_Y, armText[inavData.armed], 5, SMLSIZE | CENTERED); drawValueWithUnit(LCD_W - 6, 0, rxBatt, UNIT_VOLTS, PREC1 | RIGHT); drawTelemetryTopBar(); // after rxBatt to add INVERS From 6ca8aa73ee23f8e7c19a0b2854adcd046793eb6c Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 16:38:20 -0400 Subject: [PATCH 86/99] CRSF ARM --- radio/src/targets/flysky/tools/inav.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index f31abb49fe..cf078d7590 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -215,7 +215,9 @@ if (inavData.MapPSign>0){ //positive N up inavData.currentLon = telemetryItem.gps.latitude; } else if(i==6){ TXPW= telemetryItem.value;//[7-1]:ELRS TX Power - } + } else if(i==10){ //CRSF ARM + inavData.armed = telemetryItem.value; + #endif // INAVLITE_CRSF } else if (telemetryProtocol == PROTOCOL_FLYSKY_IBUS) { #if defined(INAVLITE_AFHDS2A) From 50987747be6999657b5bd24e99a39c6d78a43043 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 16:39:58 -0400 Subject: [PATCH 87/99] } --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index cf078d7590..1986197736 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -217,7 +217,7 @@ if (inavData.MapPSign>0){ //positive N up TXPW= telemetryItem.value;//[7-1]:ELRS TX Power } else if(i==10){ //CRSF ARM inavData.armed = telemetryItem.value; - + } #endif // INAVLITE_CRSF } else if (telemetryProtocol == PROTOCOL_FLYSKY_IBUS) { #if defined(INAVLITE_AFHDS2A) From 00f329c7c052ff8ca8cf37044c183fdbe65a154b Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 16:47:14 -0400 Subject: [PATCH 88/99] vspd --- radio/src/targets/flysky/tools/inav.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 1986197736..7cb254094d 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -218,7 +218,8 @@ if (inavData.MapPSign>0){ //positive N up } else if(i==10){ //CRSF ARM inavData.armed = telemetryItem.value; } -#endif // INAVLITE_CRSF +#endif // INAVLITE_CRSF=END + } else if (telemetryProtocol == PROTOCOL_FLYSKY_IBUS) { #if defined(INAVLITE_AFHDS2A) if (g_model.telemetrySensors[i].id == 0xfc) { // RX RSSI @@ -318,13 +319,13 @@ if (inavData.MapPSign>0){ //positive N up // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); - lcdDrawNumber(INAV_SATS_X-8, INAV_SATS_Y + 18, vspd, SMLSIZE | RIGHT); + lcdDrawNumber(INAV_ALT_X, INAV_ALT_Y, vspd, SMLSIZE | RIGHT); static const char armText[2][5] = { {'O', 'F', 'F', '\0', ' '}, {'A', 'R', 'M', 'E', 'D'} }; - lcdDrawSizedText(INAV_DIST_X, INAV_DIST_Y, armText[inavData.armed], 5, SMLSIZE | CENTERED); + lcdDrawSizedText(INAV_DIST_X+8, INAV_DIST_Y, armText[inavData.armed], 5, SMLSIZE | RIGHT); drawValueWithUnit(LCD_W - 6, 0, rxBatt, UNIT_VOLTS, PREC1 | RIGHT); drawTelemetryTopBar(); // after rxBatt to add INVERS From fdba6184cbc79b7360c93bc6760097356485a6a7 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 16:55:49 -0400 Subject: [PATCH 89/99] TINSIZE --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 7cb254094d..7539085720 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -319,13 +319,13 @@ if (inavData.MapPSign>0){ //positive N up // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); - lcdDrawNumber(INAV_ALT_X, INAV_ALT_Y, vspd, SMLSIZE | RIGHT); + //lcdDrawNumber(INAV_ALT_X, INAV_ALT_Y, vspd, SMLSIZE | RIGHT); static const char armText[2][5] = { {'O', 'F', 'F', '\0', ' '}, {'A', 'R', 'M', 'E', 'D'} }; - lcdDrawSizedText(INAV_DIST_X+8, INAV_DIST_Y, armText[inavData.armed], 5, SMLSIZE | RIGHT); + lcdDrawSizedText(INAV_DIST_X+20, INAV_DIST_Y, armText[inavData.armed], 5, TINSIZE); drawValueWithUnit(LCD_W - 6, 0, rxBatt, UNIT_VOLTS, PREC1 | RIGHT); drawTelemetryTopBar(); // after rxBatt to add INVERS From 6851d6f8dba113f432a5faa9e4dfc0013b96d26f Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 16:58:53 -0400 Subject: [PATCH 90/99] INAV_BATTP_X, INAV_BATTP_Y --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 7539085720..9fdd79282a 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -325,7 +325,7 @@ if (inavData.MapPSign>0){ //positive N up {'O', 'F', 'F', '\0', ' '}, {'A', 'R', 'M', 'E', 'D'} }; - lcdDrawSizedText(INAV_DIST_X+20, INAV_DIST_Y, armText[inavData.armed], 5, TINSIZE); + lcdDrawSizedText(INAV_BATTP_X+10, INAV_BATTP_Y, armText[inavData.armed], 5, TINSIZE); drawValueWithUnit(LCD_W - 6, 0, rxBatt, UNIT_VOLTS, PREC1 | RIGHT); drawTelemetryTopBar(); // after rxBatt to add INVERS From 8366e810bdf5970cc8c6367a7a4843d30103fe36 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 17:10:01 -0400 Subject: [PATCH 91/99] No Arm --- radio/src/targets/flysky/tools/inav.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 9fdd79282a..f69be85c19 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -320,13 +320,13 @@ if (inavData.MapPSign>0){ //positive N up // lcdDrawNumber(70, 20, inavData.currentLat, SMLSIZE | RIGHT); // lcdDrawNumber(70, 30, inavData.currentLon, SMLSIZE | RIGHT); //lcdDrawNumber(INAV_ALT_X, INAV_ALT_Y, vspd, SMLSIZE | RIGHT); - +/* static const char armText[2][5] = { {'O', 'F', 'F', '\0', ' '}, {'A', 'R', 'M', 'E', 'D'} }; - lcdDrawSizedText(INAV_BATTP_X+10, INAV_BATTP_Y, armText[inavData.armed], 5, TINSIZE); - + lcdDrawSizedText(INAV_BATTP_X+10, INAV_GALT_Y, armText[inavData.armed], 5, TINSIZE); +*/ drawValueWithUnit(LCD_W - 6, 0, rxBatt, UNIT_VOLTS, PREC1 | RIGHT); drawTelemetryTopBar(); // after rxBatt to add INVERS From 2e7750fb3537f573f9b14f9853c9a955d4b9ca9b Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 20:28:07 -0400 Subject: [PATCH 92/99] 360 rotation --- radio/src/targets/flysky/tools/inav.cpp | 60 +++++++++++++++++-------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index f69be85c19..ed01a9b459 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -63,9 +63,12 @@ struct InavData { int32_t currentLon; // uint8_t homeHeading; uint8_t heading; - int8_t MapPSign;//default (+):north up|(-):north down uint8_t armed = 1; uint8_t lastMode = 0; + + int8_t MapPSign_X;//default (+):north up|(-):north down + int8_t MapPSign_Y; + uint8_t MapOR; }; static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0]; @@ -89,7 +92,10 @@ static void inavSetHome() { } static void inavSetMapN() { - inavData.MapPSign *= -1;//rotating the map 180 deg. + inavData.MapOR+=1;//rotating the map 180 deg. + if (MapOR>3){ + MapOR=0; + } } static void inavDrawHome(uint8_t x, uint8_t y) { @@ -155,16 +161,36 @@ static void inavDraw() { lcdDrawLine(LCD_W - 30, (LCD_H / 2) + FH / 2, LCD_W - 28, (LCD_H / 2) + FH / 2, DOTTED, FORCE); //MAP-Direction-Legend -if (inavData.MapPSign>0){ //positive N up - lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE); - lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down -}else if(inavData.MapPSign<0){//negative north down: 180deg rotation - lcdDrawText(LCD_W - 37, LCD_H/2, "W", SMLSIZE); - lcdDrawText(LCD_W/2-1 , LCD_H-6, "N", SMLSIZE);//down -}else{//inititial value - inavData.MapPSign=1; +switch(inavData.MapOR) { + case 0://positive N up + lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE);//right + lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down + InavData.MapPSign_X=1; + InavData.MapPSign_Y=1; + break; + + case 1://negative north down: 180deg rotation + lcdDrawText(LCD_W - 37, LCD_H/2, "S", SMLSIZE);//right + lcdDrawText(LCD_W/2-1 , LCD_H-6, "E", SMLSIZE);//down + InavData.MapPSign_X=-1; + InavData.MapPSign_Y=1; + break; + + case 2: + lcdDrawText(LCD_W - 37, LCD_H/2, "W", SMLSIZE);//right + lcdDrawText(LCD_W/2-1 , LCD_H-6, "N", SMLSIZE);//down + InavData.MapPSign_X=-1; + InavData.MapPSign_Y=-1; + break; + + case 3: + lcdDrawText(LCD_W - 37, LCD_H/2, "N", SMLSIZE);//right + lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down + InavData.MapPSign_X=1; + InavData.MapPSign_Y=-1; + break; + } -// uint8_t rxBatt = 0, sats = 0; int32_t dist = 0, alt = 0, galt = 0, speed = 0, current = 0, TXPW = 0; @@ -362,14 +388,12 @@ if (inavData.MapPSign>0){ //positive N up int32_t translatedCurrentLat = inavData.currentLat - centerLat; // rotate to homeHeading - // ... - + // ... // scale:: //considering the North Position::inavData.MapPSign - int8_t scaledHomeLon = inavData.MapPSign* translatedHomeLon / scaleFactor; - int8_t scaledHomeLat = inavData.MapPSign* translatedHomeLat / scaleFactor; - int8_t scaledCurrentLon = inavData.MapPSign* translatedCurrentLon / scaleFactor; - int8_t scaledCurrentLat = inavData.MapPSign* translatedCurrentLat / scaleFactor; - + int8_t scaledHomeLon = inavData.MapPSign_Y* translatedHomeLon / scaleFactor; + int8_t scaledHomeLat = inavData.MapPSign_X* translatedHomeLat / scaleFactor; + int8_t scaledCurrentLon = inavData.MapPSign_Y* translatedCurrentLon / scaleFactor; + int8_t scaledCurrentLat = inavData.MapPSign_X* translatedCurrentLat / scaleFactor; // translate to LCD center space and draw inavDrawHome(BBOX_CENTER_X + scaledHomeLat, BBOX_CENTER_Y - scaledHomeLon); From be5b7057ef439fadd6241cb99b3b643d67940066 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 20:30:07 -0400 Subject: [PATCH 93/99] inavData-360deg --- radio/src/targets/flysky/tools/inav.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index ed01a9b459..ff774bf1cb 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -165,29 +165,29 @@ switch(inavData.MapOR) { case 0://positive N up lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE);//right lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down - InavData.MapPSign_X=1; - InavData.MapPSign_Y=1; + inavData.MapPSign_X=1; + inavData.MapPSign_Y=1; break; case 1://negative north down: 180deg rotation lcdDrawText(LCD_W - 37, LCD_H/2, "S", SMLSIZE);//right lcdDrawText(LCD_W/2-1 , LCD_H-6, "E", SMLSIZE);//down - InavData.MapPSign_X=-1; - InavData.MapPSign_Y=1; + inavData.MapPSign_X=-1; + inavData.MapPSign_Y=1; break; case 2: lcdDrawText(LCD_W - 37, LCD_H/2, "W", SMLSIZE);//right lcdDrawText(LCD_W/2-1 , LCD_H-6, "N", SMLSIZE);//down - InavData.MapPSign_X=-1; - InavData.MapPSign_Y=-1; + inavData.MapPSign_X=-1; + inavData.MapPSign_Y=-1; break; case 3: lcdDrawText(LCD_W - 37, LCD_H/2, "N", SMLSIZE);//right lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down - InavData.MapPSign_X=1; - InavData.MapPSign_Y=-1; + inavData.MapPSign_X=1; + inavData.MapPSign_Y=-1; break; } From b3492c78567ebe6f48b18144a7981fcc7192e597 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 20:31:36 -0400 Subject: [PATCH 94/99] inavData.MapOR --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index ff774bf1cb..32f45ffa25 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -93,8 +93,8 @@ static void inavSetHome() { static void inavSetMapN() { inavData.MapOR+=1;//rotating the map 180 deg. - if (MapOR>3){ - MapOR=0; + if (inavData.MapOR>3){ + inavData.MapOR=0; } } From 392b4a8ff36bc84fd0b3bae693db82a946c1e818 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 20:49:27 -0400 Subject: [PATCH 95/99] LableFIX-360 --- radio/src/targets/flysky/tools/inav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 32f45ffa25..9b35942f32 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -171,7 +171,7 @@ switch(inavData.MapOR) { case 1://negative north down: 180deg rotation lcdDrawText(LCD_W - 37, LCD_H/2, "S", SMLSIZE);//right - lcdDrawText(LCD_W/2-1 , LCD_H-6, "E", SMLSIZE);//down + lcdDrawText(LCD_W/2-1 , LCD_H-6, "W", SMLSIZE);//down inavData.MapPSign_X=-1; inavData.MapPSign_Y=1; break; @@ -185,7 +185,7 @@ switch(inavData.MapOR) { case 3: lcdDrawText(LCD_W - 37, LCD_H/2, "N", SMLSIZE);//right - lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down + lcdDrawText(LCD_W/2-1 , LCD_H-6, "E", SMLSIZE);//down inavData.MapPSign_X=1; inavData.MapPSign_Y=-1; break; From 7597c7c8c27bc47bf985a9a67756aac8f605babf Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 21:06:15 -0400 Subject: [PATCH 96/99] Clockwise360Rotation --- radio/src/targets/flysky/tools/inav.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 9b35942f32..cd6c2b669a 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -169,11 +169,11 @@ switch(inavData.MapOR) { inavData.MapPSign_Y=1; break; - case 1://negative north down: 180deg rotation - lcdDrawText(LCD_W - 37, LCD_H/2, "S", SMLSIZE);//right - lcdDrawText(LCD_W/2-1 , LCD_H-6, "W", SMLSIZE);//down - inavData.MapPSign_X=-1; - inavData.MapPSign_Y=1; + case 1: + lcdDrawText(LCD_W - 37, LCD_H/2, "N", SMLSIZE);//right + lcdDrawText(LCD_W/2-1 , LCD_H-6, "E", SMLSIZE);//down + inavData.MapPSign_X=1; + inavData.MapPSign_Y=-1; break; case 2: @@ -183,11 +183,11 @@ switch(inavData.MapOR) { inavData.MapPSign_Y=-1; break; - case 3: - lcdDrawText(LCD_W - 37, LCD_H/2, "N", SMLSIZE);//right - lcdDrawText(LCD_W/2-1 , LCD_H-6, "E", SMLSIZE);//down - inavData.MapPSign_X=1; - inavData.MapPSign_Y=-1; + case 3://negative north down: 180deg rotation + lcdDrawText(LCD_W - 37, LCD_H/2, "S", SMLSIZE);//right + lcdDrawText(LCD_W/2-1 , LCD_H-6, "W", SMLSIZE);//down + inavData.MapPSign_X=-1; + inavData.MapPSign_Y=1; break; } From ee0405d1fe127b57d54d399660748d074214bb80 Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 21:09:20 -0400 Subject: [PATCH 97/99] Clockwise360 --- radio/src/targets/flysky/tools/inav.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index cd6c2b669a..7fbca1b604 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -169,11 +169,11 @@ switch(inavData.MapOR) { inavData.MapPSign_Y=1; break; - case 1: - lcdDrawText(LCD_W - 37, LCD_H/2, "N", SMLSIZE);//right - lcdDrawText(LCD_W/2-1 , LCD_H-6, "E", SMLSIZE);//down + case 1://negative north down: 180deg rotation + lcdDrawText(LCD_W - 37, LCD_H/2, "S", SMLSIZE);//right + lcdDrawText(LCD_W/2-1 , LCD_H-6, "W", SMLSIZE);//down inavData.MapPSign_X=1; - inavData.MapPSign_Y=-1; + inavData.MapPSign_Y=-1; break; case 2: @@ -183,11 +183,11 @@ switch(inavData.MapOR) { inavData.MapPSign_Y=-1; break; - case 3://negative north down: 180deg rotation - lcdDrawText(LCD_W - 37, LCD_H/2, "S", SMLSIZE);//right - lcdDrawText(LCD_W/2-1 , LCD_H-6, "W", SMLSIZE);//down + case 3: + lcdDrawText(LCD_W - 37, LCD_H/2, "N", SMLSIZE);//right + lcdDrawText(LCD_W/2-1 , LCD_H-6, "E", SMLSIZE);//down inavData.MapPSign_X=-1; - inavData.MapPSign_Y=1; + inavData.MapPSign_Y=1; break; } From 269563e9cafe9b2486d8b398af96c2000f6220dd Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 21:10:31 -0400 Subject: [PATCH 98/99] comments-added --- radio/src/targets/flysky/tools/inav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 7fbca1b604..57dd7b2da1 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -161,7 +161,7 @@ static void inavDraw() { lcdDrawLine(LCD_W - 30, (LCD_H / 2) + FH / 2, LCD_W - 28, (LCD_H / 2) + FH / 2, DOTTED, FORCE); //MAP-Direction-Legend -switch(inavData.MapOR) { +switch(inavData.MapOR) { //90-deg each rotation:clockiwse case 0://positive N up lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE);//right lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);//down From 8c5910ebb14d9088097e2eeeb421a7410481b58d Mon Sep 17 00:00:00 2001 From: Alex_SubZ <37748115+FRPProject@users.noreply.github.com> Date: Mon, 20 May 2024 22:30:55 -0400 Subject: [PATCH 99/99] craftAngle-360 --- radio/src/targets/flysky/tools/inav.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/radio/src/targets/flysky/tools/inav.cpp b/radio/src/targets/flysky/tools/inav.cpp index 57dd7b2da1..4140019237 100644 --- a/radio/src/targets/flysky/tools/inav.cpp +++ b/radio/src/targets/flysky/tools/inav.cpp @@ -118,10 +118,10 @@ static void inavDrawCraft(uint8_t x, uint8_t y) { int8_t rotatedPRX = (pRX * cosVal - pRY * sinVal) >> 7; int8_t rotatedPRY = (pRY * cosVal + pRX * sinVal) >> 7; - uint8_t tPLX = x + rotatedPLX; - uint8_t tPLY = y + rotatedPLY; - uint8_t tPRX = x + rotatedPRX; - uint8_t tPRY = y + rotatedPRY; + uint8_t tPLX = x + inavData.MapPSign_X * rotatedPLX; + uint8_t tPLY = y + inavData.MapPSign_Y * rotatedPLY; + uint8_t tPRX = x + inavData.MapPSign_X * rotatedPRX; + uint8_t tPRY = y + inavData.MapPSign_Y * rotatedPRY; // translate and draw lcdDrawLine(x, y, tPLX, tPLY, SOLID, FORCE);