Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INAV LITE FIX #370

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 4 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- checkout
- run:
name: Build
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
Expand Down Expand Up @@ -111,50 +111,17 @@ workflows:
openi6x-release-workflow:
jobs:
- build-en:
filters:
branches:
ignore:
- master
- build-std:
filters:
branches:
only:
- master
- build-std-backlight:
filters:
branches:
only:
- master
- build-elrs:
filters:
branches:
only:
- master

- build-elrs-backlight:
filters:
branches:
only:
- master
- build-heli:
filters:
branches:
only:
- master
- build-heli-backlight:
filters:
branches:
only:
- master
- build-std:
filters:
branches:
only:
- master
- build-std-backlight:
filters:
branches:
only:
- master
- master

# - publish-github-release:
## filters:
## branches:
Expand Down
4 changes: 2 additions & 2 deletions radio/src/gui/128x64/lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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-6, 0, timersStates[0].val, att, att);
}
lcdInvertLine(0);
}
Expand Down
6 changes: 3 additions & 3 deletions radio/src/gui/212x64/lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,15 +497,15 @@ void drawTelemetryTopBar()
{
putsModelName(0, 0, g_model.header.name, g_eeGeneral.currModel, 0);
uint8_t att = (IS_TXBATT_WARNING() ? BLINK : 0);
putsVBat(12*FW, 0, att);
//putsVBat(12*FW, 0, att);
if (g_model.timers[0].mode) {
att = (timersStates[0].val<0 ? BLINK : 0);
drawTimer(22*FW, 0, timersStates[0].val, att, att);
drawTimer(12*FW, 0, timersStates[0].val, att, att);//changed
lcdDrawText(22*FW, 0, "T1:", RIGHT);
}
if (g_model.timers[1].mode) {
att = (timersStates[1].val<0 ? BLINK : 0);
drawTimer(31*FW, 0, timersStates[1].val, att, att);
drawTimer(12*FW, 0, timersStates[1].val, att, att);//changed
lcdDrawText(31*FW, 0, "T2:", RIGHT);
}
lcdInvertLine(0);
Expand Down
36 changes: 19 additions & 17 deletions radio/src/targets/flysky/tools/inav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,16 @@ struct InavData {
int32_t homeLon;
int32_t currentLat;
int32_t currentLon;
// uint8_t homeHeading;
uint8_t heading;
};

static InavData inavData; // = (InavData *)&reusableBuffer.cToolData[0];

/*
static Point2D rotate(Point2D *p, uint8_t angle) {
Point2D rotated;
int8_t sinVal = sine[angle];
int8_t cosVal = sine[(angle + 8) & 0x1F];
rotated.x = (p->x * cosVal - p->y * sinVal) >> 7;
rotated.y = (p->y * cosVal + p->x * sinVal) >> 7;
return rotated;
}
*/

static void inavSetHome() {
inavData.homeLat = inavData.currentLat;
inavData.homeLon = inavData.currentLon;
// inavData.homeHeading = inavData.heading;
buzzerEvent(AU_SPECIAL_SOUND_WARN1);
}

static void inavDrawHome(uint8_t x, uint8_t y) {
Expand Down Expand Up @@ -111,6 +99,7 @@ static void inavDrawCraft(uint8_t x, uint8_t y) {
lcdDrawLine(x, y, tPLX, tPLY, SOLID, FORCE);
lcdDrawLine(x, y, tPRX, tPRY, SOLID, FORCE);
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
Expand All @@ -134,6 +123,14 @@ static void inavDrawAFHDS2AFM(uint8_t mode) {
static void inavDraw() {
lcdDrawSolidVerticalLine(36, FH, LCD_H - FH, FORCE);
lcdDrawSolidVerticalLine(LCD_W - 31, FH, LCD_H - FH, FORCE);

//directions
lcdDrawText(LCD_W - 37, LCD_H/2, "E", SMLSIZE);
// lcdDrawText(36+2, LCD_H/2, "W", SMLSIZE);
// lcdDrawText(LCD_W/2-1 , INAV_FM_X+10, "N", SMLSIZE);
lcdDrawText(LCD_W/2-1 , LCD_H-6, "S", SMLSIZE);
//

lcdDrawSolidVerticalLine(LCD_W - 27, FH, LCD_H - FH, FORCE);
lcdDrawSolidHorizontalLine(0, 55, 36, FORCE);
lcdDrawSolidHorizontalLine(LCD_W - 26, 51, 32, FORCE);
Expand All @@ -157,7 +154,7 @@ static void inavDraw() {
if (strstr(sensor.label, ZSTR_RX_RSSI1)) { // RSSI
rssi = telemetryItem.value;
} else if (strstr(sensor.label, ZSTR_ALT)) { // Altitude
alt = telemetryItem.value;
alt = telemetryItem.value;
} else if (strstr(sensor.label, ZSTR_GPSALT)) { // GPS altitude
galt = telemetryItem.value;
} else if (strstr(sensor.label, ZSTR_VSPD)) { // VSpd
Expand Down Expand Up @@ -295,13 +292,17 @@ 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);
inavDrawCraft(BBOX_CENTER_X - scaledCurrentLat, BBOX_CENTER_Y + scaledCurrentLon);
//+/- changed
inavDrawHome(BBOX_CENTER_X + scaledHomeLat, BBOX_CENTER_Y - scaledHomeLon);

//+/- changed for correcting 180 deg
inavDrawCraft(BBOX_CENTER_X + scaledCurrentLat, BBOX_CENTER_Y - scaledCurrentLon);

// draw VSpd line
vspd = limit<int16_t>(-5, vspd / 4, 5);
Expand All @@ -320,6 +321,7 @@ void inavRun(event_t event) {
popMenu();
} else if (event == EVT_KEY_LONG(KEY_ENTER)) { // set home on long press OK
inavSetHome();
buzzerEvent(AU_SPECIAL_SOUND_WARN2);
}

inavDraw();
Expand Down
12 changes: 1 addition & 11 deletions tools/build-flysky.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,7 @@
}

translations = [
"EN",
"PL",
"CZ",
"DE",
"ES",
"PT",
"NL",
"SE",
"FI",
"IT",
"FR"
"EN"
]

common_options = {
Expand Down