1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 00:35:34 +03:00

Merge branch 'release_6.1.0' into SITL

This commit is contained in:
Andi Kanzler 2023-03-23 18:51:10 -03:00 committed by GitHub
commit 6ff514d8ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
256 changed files with 146215 additions and 501 deletions

View file

@ -1124,6 +1124,25 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
serializeSDCardSummaryReply(dst);
break;
#if defined (USE_DJI_HD_OSD) || defined (USE_MSP_DISPLAYPORT)
case MSP_BATTERY_STATE:
// Battery characteristics
sbufWriteU8(dst, constrain(getBatteryCellCount(), 0, 255));
sbufWriteU16(dst, currentBatteryProfile->capacity.value);
// Battery state
sbufWriteU8(dst, constrain(getBatteryVoltage() / 10, 0, 255)); // in 0.1V steps
sbufWriteU16(dst, constrain(getMAhDrawn(), 0, 0xFFFF));
sbufWriteU16(dst, constrain(getAmperage(), -0x8000, 0x7FFF));
// Battery alerts - used values match Betaflight's/DJI's
sbufWriteU8(dst, getBatteryState());
// Additional battery voltage field (in 0.01V steps)
sbufWriteU16(dst, getBatteryVoltage());
break;
#endif
case MSP_OSD_CONFIG:
#ifdef USE_OSD
sbufWriteU8(dst, OSD_DRIVER_MAX7456); // OSD supported
@ -3228,8 +3247,12 @@ static bool mspParameterGroupsCommand(sbuf_t *dst, sbuf_t *src)
#ifdef USE_SIMULATOR
bool isOSDTypeSupportedBySimulator(void)
{
#ifdef USE_OSD
displayPort_t *osdDisplayPort = osdGetDisplayPort();
return (osdDisplayPort && osdDisplayPort->cols == 30 && (osdDisplayPort->rows == 13 || osdDisplayPort->rows == 16));
#else
return false;
#endif
}
void mspWriteSimulatorOSD(sbuf_t *dst)