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

Merge pull request #8860 from iNavFlight/dzikuvx-fix-compilation-without-osd

Fix compilation if OSD is disabled
This commit is contained in:
Paweł Spychalski 2023-03-23 15:49:10 +01:00 committed by GitHub
commit 4be5a2f5e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 5 deletions

View file

@ -340,7 +340,9 @@ void processSaveConfigAndNotify(void)
writeEEPROM();
readEEPROM();
beeperConfirmationBeeps(1);
#ifdef USE_OSD
osdShowEEPROMSavedNotification();
#endif
}
void writeEEPROM(void)
@ -370,7 +372,9 @@ void ensureEEPROMContainsValidData(void)
*/
void saveConfigAndNotify(void)
{
#ifdef USE_OSD
osdStartedSaveProcess();
#endif
saveState = SAVESTATE_SAVEANDNOTIFY;
}

View file

@ -3240,8 +3240,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)

View file

@ -17,7 +17,7 @@
#include "platform.h"
#ifdef USE_MSP_DISPLAYPORT
#if defined(USE_OSD) && defined(USE_MSP_DISPLAYPORT)
#ifndef DISABLE_MSP_BF_COMPAT

View file

@ -22,7 +22,7 @@
#include "platform.h"
#if defined(USE_MSP_DISPLAYPORT) && !defined(DISABLE_MSP_BF_COMPAT)
#if defined(USE_OSD) && defined(USE_MSP_DISPLAYPORT) && !defined(DISABLE_MSP_BF_COMPAT)
#include "osd.h"
uint8_t getBfCharacter(uint8_t ch, uint8_t page);
#define isBfCompatibleVideoSystem(osdConfigPtr) (osdConfigPtr->video_system == VIDEO_SYSTEM_BFCOMPAT)

View file

@ -242,6 +242,7 @@ STATIC_UNIT_TESTED uint8_t crsfFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
rxLinkStatistics.uplinkTXPower = crsfTxPowerStatesmW[crsftxpowerindex];
rxLinkStatistics.activeAntenna = linkStats->activeAntenna;
#ifdef USE_OSD
if (rxLinkStatistics.uplinkLQ > 0) {
int16_t uplinkStrength; // RSSI dBm converted to %
uplinkStrength = constrain((100 * sq((osdConfig()->rssi_dbm_max - osdConfig()->rssi_dbm_min)) - (100 * sq((osdConfig()->rssi_dbm_max - rxLinkStatistics.uplinkRSSI)))) / sq((osdConfig()->rssi_dbm_max - osdConfig()->rssi_dbm_min)),0,100);
@ -250,10 +251,10 @@ STATIC_UNIT_TESTED uint8_t crsfFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
else if (rxLinkStatistics.uplinkRSSI < osdConfig()->rssi_dbm_min)
uplinkStrength = 0;
lqTrackerSet(rxRuntimeConfig->lqTracker, scaleRange(uplinkStrength, 0, 99, 0, RSSI_MAX_VALUE));
}
else
} else {
lqTrackerSet(rxRuntimeConfig->lqTracker, 0);
}
#endif
// This is not RC channels frame, update channel value but don't indicate frame completion
return RX_FRAME_PENDING;
}