Skip to content

Commit 28e1b23

Browse files
authored
Merge branch 'maintenance-8.x.x' into abo_mc_althold_fix
2 parents 9f0ad97 + abf9730 commit 28e1b23

File tree

14 files changed

+138
-75
lines changed

14 files changed

+138
-75
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ else()
5151
endif()
5252
endif()
5353

54-
55-
project(INAV VERSION 8.1.0)
54+
project(INAV VERSION 8.0.1)
5655

5756
enable_language(ASM)
5857

docs/ADSB.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ All ADSB receivers which can send Mavlink [ADSB_VEHICLE](https://mavlink.io/en/m
1313

1414
* [PINGRX](https://uavionix.com/product/pingrx-pro/) (not tested)
1515
* [TT-SC1](https://www.aerobits.pl/product/aero/) (tested)
16+
* [ADSBee1090](https://pantsforbirds.com/adsbee-1090/) (tested)
1617

1718
## TT-SC1 settings
1819
* download software for ADSB TT-SC1 from https://www.aerobits.pl/product/aero/ , file Micro_ADSB_App-vX.XX.X_win_setup.zip and install it
@@ -24,3 +25,21 @@ All ADSB receivers which can send Mavlink [ADSB_VEHICLE](https://mavlink.io/en/m
2425
PCB board for TT-SC1-B module https://oshwlab.com/error414/adsb-power-board
2526
![TT-SC1 settings](Screenshots/ADSB_TTSC01_settings.png)
2627

28+
## ADSBee 1090 settings
29+
* connect to ADSBee1090 via USB and set COMMS_UART to mavlink2 \
30+
``
31+
AT+PROTOCOL=COMMS_UART,MAVLINK2
32+
``\
33+
``
34+
AT+BAUDRATE=COMMS_UART,115200
35+
``\
36+
It's recommended to turn of wifi \
37+
``
38+
AT+ESP32_ENABLE=0
39+
``\
40+
``
41+
AT+SETTINGS=SAVE
42+
``
43+
* in INAV configurator ports TAB set telemetry MAVLINK, and baudrate 115200
44+
* https://pantsforbirds.com/adsbee-1090/quick-start/
45+

docs/OSD.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Not all OSDs are created equally. This table shows the differences between the d
2424
| HDZero | 50 x 18 | X | | X | YES |
2525
| Avatar | 53 x 20 | X | | X | YES |
2626
| DJI O3 | 53 x 20 (HD) | X | | X (partial) | NO - BF Characters only |
27+
| DJI NATIVE | 53 x 20 (HD) | X | | X | YES (TBC) |
2728

2829
## OSD Elements
2930
Here are the OSD Elements provided by INAV.

src/main/config/config_eeprom.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ void initEEPROM(void)
118118
BUILD_BUG_ON(sizeof(configFooter_t) != 2);
119119
BUILD_BUG_ON(sizeof(configRecord_t) != 6);
120120

121+
#ifdef STM32H7A3xx
122+
BUILD_BUG_ON(CONFIG_STREAMER_BUFFER_SIZE != 16);
123+
#elif defined(STM32H743xx)
124+
BUILD_BUG_ON(CONFIG_STREAMER_BUFFER_SIZE != 32);
125+
#endif
126+
121127
#if defined(CONFIG_IN_EXTERNAL_FLASH)
122128
bool eepromLoaded = loadEEPROMFromExternalFlash();
123129
if (!eepromLoaded) {

src/main/config/config_streamer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int config_streamer_write(config_streamer_t *c, const uint8_t *p, uint32_t size)
5555
return -1;
5656
}
5757

58-
for (const uint8_t *pat = p; pat != (uint8_t*)p + size; pat++) {
58+
for (const uint8_t *pat = p; pat != (uint8_t *)p + size; pat++) {
5959
c->buffer.b[c->at++] = *pat;
6060

6161
if (c->at == sizeof(c->buffer)) {
@@ -81,7 +81,7 @@ int config_streamer_flush(config_streamer_t *c)
8181
c->err = config_streamer_impl_write_word(c, &c->buffer.w);
8282
c->at = 0;
8383
}
84-
return c-> err;
84+
return c->err;
8585
}
8686

8787
int config_streamer_finish(config_streamer_t *c)
@@ -91,4 +91,4 @@ int config_streamer_finish(config_streamer_t *c)
9191
c->unlocked = false;
9292
}
9393
return c->err;
94-
}
94+
}

src/main/config/config_streamer.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@
2727

2828
#ifdef CONFIG_IN_EXTERNAL_FLASH
2929
#define CONFIG_STREAMER_BUFFER_SIZE M25P16_PAGESIZE // Must match flash device page size
30-
typedef uint32_t config_streamer_buffer_align_type_t;
3130
#elif defined(STM32H7)
32-
#define CONFIG_STREAMER_BUFFER_SIZE 32 // Flash word = 256-bits
33-
typedef uint64_t config_streamer_buffer_align_type_t;
31+
#define CONFIG_STREAMER_BUFFER_SIZE (FLASH_NB_32BITWORD_IN_FLASHWORD * 4) // Flash word = 256-bits or 128bits, depending on the mcu
3432
#else
3533
#define CONFIG_STREAMER_BUFFER_SIZE 4
36-
typedef uint32_t config_streamer_buffer_align_type_t;
3734
#endif
3835

36+
typedef uint32_t config_streamer_buffer_align_type_t;
37+
3938
typedef struct config_streamer_s {
4039
uintptr_t address;
4140
uintptr_t end;

src/main/config/config_streamer_stm32h7.c

Lines changed: 62 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,45 @@
1515
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
#include <string.h>
19-
#include "platform.h"
20-
#include "drivers/system.h"
21-
#include "config/config_streamer.h"
18+
#include <string.h>
19+
#include "platform.h"
20+
#include "drivers/system.h"
21+
#include "config/config_streamer.h"
22+
23+
#if defined(STM32H7) && !defined(CONFIG_IN_RAM) && !defined(CONFIG_IN_EXTERNAL_FLASH)
2224

23-
#if defined(STM32H7) && !defined(CONFIG_IN_RAM) && !defined(CONFIG_IN_EXTERNAL_FLASH)
25+
static uint32_t getFLASHBankForEEPROM(uint32_t address)
26+
{
27+
#ifdef DUAL_BANK
28+
if (address < (FLASH_BASE + FLASH_BANK_SIZE)) {
29+
return FLASH_BANK_1;
30+
}
31+
32+
return FLASH_BANK_2;
33+
#else
34+
return FLASH_BANK_1;
35+
#endif
36+
}
37+
38+
#if defined(STM32H7A3xx)
39+
static uint32_t getFLASHSectorForEEPROM(uint32_t address)
40+
{
41+
uint32_t sector = 0;
42+
43+
if (address < (FLASH_BASE + FLASH_BANK_SIZE)) {
44+
sector = (address - FLASH_BASE) / FLASH_SECTOR_SIZE;
45+
} else {
46+
sector = (address - (FLASH_BASE + FLASH_BANK_SIZE)) / FLASH_SECTOR_SIZE;
47+
}
2448

25-
#if defined(STM32H743xx)
49+
if (sector > FLASH_SECTOR_TOTAL) {
50+
failureMode(FAILURE_FLASH_WRITE_FAILED);
51+
}
52+
53+
return sector;
54+
}
55+
#elif defined(STM32H743xx)
2656
/* Sectors 0-7 of 128K each */
27-
#define FLASH_PAGE_SIZE ((uint32_t)0x20000) // 128K sectors
2857
static uint32_t getFLASHSectorForEEPROM(uint32_t address)
2958
{
3059
if (address <= 0x0801FFFF)
@@ -49,9 +78,9 @@ static uint32_t getFLASHSectorForEEPROM(uint32_t address)
4978
}
5079
}
5180
#elif defined(STM32H750xx)
52-
# error "STM32750xx only has one flash page which contains the bootloader, no spare flash pages available, use external storage for persistent config or ram for target testing"
81+
#error "STM32750xx only has one flash page which contains the bootloader, no spare flash pages available, use external storage for persistent config or ram for target testing"
5382
#else
54-
# error "Unsupported CPU!"
83+
#error "Unsupported CPU!"
5584
#endif
5685

5786
void config_streamer_impl_unlock(void)
@@ -70,30 +99,31 @@ int config_streamer_impl_write_word(config_streamer_t *c, config_streamer_buffer
7099
return c->err;
71100
}
72101

73-
if (c->address % FLASH_PAGE_SIZE == 0) {
102+
if (c->address % FLASH_SECTOR_SIZE == 0) {
74103
FLASH_EraseInitTypeDef EraseInitStruct = {
75-
.TypeErase = FLASH_TYPEERASE_SECTORS,
76-
.VoltageRange = FLASH_VOLTAGE_RANGE_3, // 2.7-3.6V
77-
.NbSectors = 1,
78-
.Banks = FLASH_BANK_1
79-
};
80-
EraseInitStruct.Sector = getFLASHSectorForEEPROM(c->address);
81-
82-
uint32_t SECTORError;
83-
const HAL_StatusTypeDef status = HAL_FLASHEx_Erase(&EraseInitStruct, &SECTORError);
84-
if (status != HAL_OK) {
85-
return -1;
86-
}
87-
}
104+
.TypeErase = FLASH_TYPEERASE_SECTORS,
105+
#ifdef FLASH_VOLTAGE_RANGE_3
106+
.VoltageRange = FLASH_VOLTAGE_RANGE_3, // 2.7-3.6V
107+
#endif
108+
.NbSectors = 1};
109+
EraseInitStruct.Banks = getFLASHBankForEEPROM(c->address);
110+
EraseInitStruct.Sector = getFLASHSectorForEEPROM(c->address);
88111

89-
// On H7 HAL_FLASH_Program takes data address, not the raw word value
90-
const HAL_StatusTypeDef status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, c->address, (uint32_t)buffer);
91-
if (status != HAL_OK) {
92-
return -2;
93-
}
112+
uint32_t SECTORError;
113+
const HAL_StatusTypeDef status = HAL_FLASHEx_Erase(&EraseInitStruct, &SECTORError);
114+
if (status != HAL_OK) {
115+
return -1;
116+
}
117+
}
94118

95-
c->address += CONFIG_STREAMER_BUFFER_SIZE;
96-
return 0;
97-
}
119+
// On H7 HAL_FLASH_Program takes data address, not the raw word value
120+
const HAL_StatusTypeDef status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, c->address, (uint32_t)buffer);
121+
if (status != HAL_OK) {
122+
return -2;
123+
}
98124

99-
#endif
125+
c->address += CONFIG_STREAMER_BUFFER_SIZE;
126+
return 0;
127+
}
128+
129+
#endif

src/main/drivers/osd.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ typedef enum {
5050
VIDEO_SYSTEM_DJIWTF,
5151
VIDEO_SYSTEM_AVATAR,
5252
VIDEO_SYSTEM_DJICOMPAT,
53-
VIDEO_SYSTEM_DJICOMPAT_HD
53+
VIDEO_SYSTEM_DJICOMPAT_HD,
54+
VIDEO_SYSTEM_DJI_NATIVE
5455
} videoSystem_e;
5556

5657
typedef enum {

src/main/fc/cli.c

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,11 +1578,11 @@ static void printGeozones(uint8_t dumpMask, const geoZoneConfig_t *geoZone, cons
15781578
&& geoZone[i].fenceAction == defaultGeoZone->fenceAction
15791579
&& geoZone[i].vertexCount == defaultGeoZone->vertexCount;
15801580

1581-
cliDefaultPrintLinef(dumpMask, equalsDefault, format, defaultGeoZone[i].shape, defaultGeoZone[i].type, defaultGeoZone[i].minAltitude, defaultGeoZone[i].maxAltitude, defaultGeoZone[i].isSealevelRef, defaultGeoZone[i].fenceAction, defaultGeoZone[i].vertexCount);
1581+
cliDefaultPrintLinef(dumpMask, equalsDefault, format, defaultGeoZone[i].shape, defaultGeoZone[i].type, defaultGeoZone[i].minAltitude, defaultGeoZone[i].maxAltitude, defaultGeoZone[i].isSealevelRef, defaultGeoZone[i].fenceAction, defaultGeoZone[i].vertexCount);
15821582
}
1583-
cliDumpPrintLinef(dumpMask, equalsDefault, format, i, geoZone[i].shape, geoZone[i].type, geoZone[i].minAltitude, geoZone[i].maxAltitude, geoZone[i].isSealevelRef, geoZone[i].fenceAction, geoZone[i].vertexCount);
1583+
cliDumpPrintLinef(dumpMask, equalsDefault, format, i, geoZone[i].shape, geoZone[i].type, geoZone[i].minAltitude, geoZone[i].maxAltitude, geoZone[i].isSealevelRef, geoZone[i].fenceAction, geoZone[i].vertexCount);
15841584
}
1585-
}
1585+
}
15861586

15871587
static void printGeozoneVertices(uint8_t dumpMask, const vertexConfig_t *vertices, const vertexConfig_t *defaultVertices)
15881588
{
@@ -1594,11 +1594,11 @@ static void printGeozoneVertices(uint8_t dumpMask, const vertexConfig_t *vertice
15941594
&& vertices[i].lat == defaultVertices->lat
15951595
&& vertices[i].lon == defaultVertices->lon
15961596
&& vertices[i].zoneId == defaultVertices->zoneId;
1597-
1597+
15981598
cliDefaultPrintLinef(dumpMask, equalsDefault, format, defaultVertices[i].zoneId, defaultVertices[i].idx, defaultVertices[i].lat, defaultVertices[i].lon);
15991599
}
1600-
1601-
cliDumpPrintLinef(dumpMask, equalsDefault, format, vertices[i].zoneId, vertices[i].idx, vertices[i].lat, vertices[i].lon);
1600+
1601+
cliDumpPrintLinef(dumpMask, equalsDefault, format, vertices[i].zoneId, vertices[i].idx, vertices[i].lat, vertices[i].lon);
16021602
}
16031603

16041604
if (!defaultVertices) {
@@ -1608,10 +1608,10 @@ static void printGeozoneVertices(uint8_t dumpMask, const vertexConfig_t *vertice
16081608
}
16091609

16101610
static void cliGeozone(char* cmdLine)
1611-
{
1611+
{
16121612
if (isEmpty(cmdLine)) {
16131613
printGeozones(DUMP_MASTER, geoZonesConfig(0), NULL);
1614-
} else if (sl_strcasecmp(cmdLine, "vertex") == 0) {
1614+
} else if (sl_strcasecmp(cmdLine, "vertex") == 0) {
16151615
printGeozoneVertices(DUMP_MASTER, geoZoneVertices(0), NULL);
16161616
} else if (sl_strncasecmp(cmdLine, "vertex reset", 12) == 0) {
16171617
const char* ptr = &cmdLine[12];
@@ -1648,7 +1648,7 @@ static void cliGeozone(char* cmdLine)
16481648
const char* ptr = cmdLine;
16491649
uint8_t argumentCount = 1;
16501650

1651-
if ((ptr = nextArg(ptr))) {
1651+
if ((ptr = nextArg(ptr))) {
16521652
zoneId = fastA2I(ptr);
16531653
if (zoneId < 0) {
16541654
return;
@@ -1678,7 +1678,7 @@ static void cliGeozone(char* cmdLine)
16781678
cliShowParseError();
16791679
return;
16801680
}
1681-
1681+
16821682
if ((ptr = nextArg(ptr))) {
16831683
argumentCount++;
16841684
lon = fastA2I(ptr);
@@ -1695,7 +1695,7 @@ static void cliGeozone(char* cmdLine)
16951695
cliShowParseError();
16961696
return;
16971697
}
1698-
1698+
16991699
for (uint8_t i = 0; i < MAX_VERTICES_IN_CONFIG; i++) {
17001700
if (geoZoneVertices(i)->zoneId == zoneId && geoZoneVertices(i)->idx == vertexZoneIdx) {
17011701
geoZoneVerticesMutable(i)->lat = lat;
@@ -1719,8 +1719,8 @@ static void cliGeozone(char* cmdLine)
17191719
geoZoneVerticesMutable(vertexIdx)->lat = lat;
17201720
geoZoneVerticesMutable(vertexIdx)->lon = lon;
17211721
geoZoneVerticesMutable(vertexIdx)->zoneId = zoneId;
1722-
geoZoneVerticesMutable(vertexIdx)->idx = vertexZoneIdx;
1723-
1722+
geoZoneVerticesMutable(vertexIdx)->idx = vertexZoneIdx;
1723+
17241724
uint8_t totalVertices = geozoneGetUsedVerticesCount();
17251725
cliPrintLinef("# %u vertices free (Used %u of %u)", MAX_VERTICES_IN_CONFIG - totalVertices, totalVertices, MAX_VERTICES_IN_CONFIG);
17261726

@@ -1733,7 +1733,7 @@ static void cliGeozone(char* cmdLine)
17331733
} else {
17341734
geozoneReset(-1);
17351735
geozoneResetVertices(-1, -1);
1736-
}
1736+
}
17371737
} else {
17381738
int8_t idx = 0, isPolygon = 0, isInclusive = 0, fenceAction = 0, seaLevelRef = 0, vertexCount = 0;
17391739
int32_t minAltitude = 0, maxAltitude = 0;
@@ -1745,7 +1745,7 @@ static void cliGeozone(char* cmdLine)
17451745
cliShowArgumentRangeError("geozone index", 0, MAX_GEOZONES_IN_CONFIG - 1);
17461746
return;
17471747
}
1748-
1748+
17491749
if ((ptr = nextArg(ptr))) {
17501750
argumentCount++;
17511751
isPolygon = fastA2I(ptr);
@@ -1787,7 +1787,7 @@ static void cliGeozone(char* cmdLine)
17871787
}
17881788

17891789
if ((ptr = nextArg(ptr))){
1790-
argumentCount++;
1790+
argumentCount++;
17911791
fenceAction = fastA2I(ptr);
17921792
if (fenceAction < 0 || fenceAction > GEOFENCE_ACTION_RTH) {
17931793
cliShowArgumentRangeError("fence action", 0, GEOFENCE_ACTION_RTH);
@@ -1812,7 +1812,7 @@ static void cliGeozone(char* cmdLine)
18121812

18131813
if ((ptr = nextArg(ptr))){
18141814
argumentCount++;
1815-
}
1815+
}
18161816

18171817
if (argumentCount != 8) {
18181818
cliShowParseError();
@@ -4190,14 +4190,19 @@ static void cliStatus(char *cmdline)
41904190
#if defined(USE_OSD)
41914191
if (armingFlags & ARMING_DISABLED_NAVIGATION_UNSAFE) {
41924192
navArmingBlocker_e reason = navigationIsBlockingArming(NULL);
4193-
if (reason & NAV_ARMING_BLOCKER_JUMP_WAYPOINT_ERROR)
4193+
if (reason == NAV_ARMING_BLOCKER_JUMP_WAYPOINT_ERROR)
41944194
cliPrintLinef(" %s", OSD_MSG_JUMP_WP_MISCONFIG);
4195-
if (reason & NAV_ARMING_BLOCKER_MISSING_GPS_FIX) {
4195+
if (reason == NAV_ARMING_BLOCKER_MISSING_GPS_FIX) {
41964196
cliPrintLinef(" %s", OSD_MSG_WAITING_GPS_FIX);
41974197
} else {
4198-
if (reason & NAV_ARMING_BLOCKER_NAV_IS_ALREADY_ACTIVE)
4199-
cliPrintLinef(" %s", OSD_MSG_DISABLE_NAV_FIRST);
4200-
if (reason & NAV_ARMING_BLOCKER_FIRST_WAYPOINT_TOO_FAR)
4198+
if (reason == NAV_ARMING_BLOCKER_NAV_IS_ALREADY_ACTIVE) {
4199+
if(armingFlags & ARMING_DISABLED_RC_LINK) {
4200+
cliPrintLinef(" ENABLE RX TO CLEAR NAV");
4201+
} else {
4202+
cliPrintLinef(" %s", OSD_MSG_DISABLE_NAV_FIRST);
4203+
}
4204+
}
4205+
if (reason == NAV_ARMING_BLOCKER_FIRST_WAYPOINT_TOO_FAR)
42014206
cliPrintLinef(" FIRST WP TOO FAR");
42024207
}
42034208
}

src/main/fc/settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ tables:
6767
values: ["MAH", "WH"]
6868
enum: osd_stats_energy_unit_e
6969
- name: osd_video_system
70-
values: ["AUTO", "PAL", "NTSC", "HDZERO", "DJIWTF", "AVATAR", "BF43COMPAT", "BFHDCOMPAT"]
70+
values: ["AUTO", "PAL", "NTSC", "HDZERO", "DJIWTF", "AVATAR", "BF43COMPAT", "BFHDCOMPAT", "DJI_NATIVE"]
7171
enum: videoSystem_e
7272
- name: osd_telemetry
7373
values: ["OFF", "ON","TEST"]

src/main/io/displayport_msp_osd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ displayPort_t* mspOsdDisplayPortInit(const videoSystem_e videoSystem)
494494
break;
495495
case VIDEO_SYSTEM_DJICOMPAT_HD:
496496
case VIDEO_SYSTEM_AVATAR:
497+
case VIDEO_SYSTEM_DJI_NATIVE:
497498
currentOsdMode = HD_5320;
498499
screenRows = AVATAR_ROWS;
499500
screenCols = AVATAR_COLS;

0 commit comments

Comments
 (0)