mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 09:45:33 +03:00
Fix compilation is OSD is disabled
This commit is contained in:
parent
085b6ce97a
commit
7e6f1040da
5 changed files with 14 additions and 5 deletions
|
@ -340,7 +340,9 @@ void processSaveConfigAndNotify(void)
|
||||||
writeEEPROM();
|
writeEEPROM();
|
||||||
readEEPROM();
|
readEEPROM();
|
||||||
beeperConfirmationBeeps(1);
|
beeperConfirmationBeeps(1);
|
||||||
|
#ifdef USE_OSD
|
||||||
osdShowEEPROMSavedNotification();
|
osdShowEEPROMSavedNotification();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeEEPROM(void)
|
void writeEEPROM(void)
|
||||||
|
@ -370,7 +372,9 @@ void ensureEEPROMContainsValidData(void)
|
||||||
*/
|
*/
|
||||||
void saveConfigAndNotify(void)
|
void saveConfigAndNotify(void)
|
||||||
{
|
{
|
||||||
|
#ifdef USE_OSD
|
||||||
osdStartedSaveProcess();
|
osdStartedSaveProcess();
|
||||||
|
#endif
|
||||||
saveState = SAVESTATE_SAVEANDNOTIFY;
|
saveState = SAVESTATE_SAVEANDNOTIFY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3221,8 +3221,12 @@ static bool mspParameterGroupsCommand(sbuf_t *dst, sbuf_t *src)
|
||||||
#ifdef USE_SIMULATOR
|
#ifdef USE_SIMULATOR
|
||||||
bool isOSDTypeSupportedBySimulator(void)
|
bool isOSDTypeSupportedBySimulator(void)
|
||||||
{
|
{
|
||||||
|
#ifdef USE_OSD
|
||||||
displayPort_t *osdDisplayPort = osdGetDisplayPort();
|
displayPort_t *osdDisplayPort = osdGetDisplayPort();
|
||||||
return (osdDisplayPort && osdDisplayPort->cols == 30 && (osdDisplayPort->rows == 13 || osdDisplayPort->rows == 16));
|
return (osdDisplayPort && osdDisplayPort->cols == 30 && (osdDisplayPort->rows == 13 || osdDisplayPort->rows == 16));
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void mspWriteSimulatorOSD(sbuf_t *dst)
|
void mspWriteSimulatorOSD(sbuf_t *dst)
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
#ifdef USE_MSP_DISPLAYPORT
|
#if defined(USE_OSD) && defined(USE_MSP_DISPLAYPORT)
|
||||||
|
|
||||||
#ifndef DISABLE_MSP_BF_COMPAT
|
#ifndef DISABLE_MSP_BF_COMPAT
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "platform.h"
|
#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"
|
#include "osd.h"
|
||||||
uint8_t getBfCharacter(uint8_t ch, uint8_t page);
|
uint8_t getBfCharacter(uint8_t ch, uint8_t page);
|
||||||
#define isBfCompatibleVideoSystem(osdConfigPtr) (osdConfigPtr->video_system == VIDEO_SYSTEM_BFCOMPAT)
|
#define isBfCompatibleVideoSystem(osdConfigPtr) (osdConfigPtr->video_system == VIDEO_SYSTEM_BFCOMPAT)
|
||||||
|
|
|
@ -242,6 +242,7 @@ STATIC_UNIT_TESTED uint8_t crsfFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
|
||||||
rxLinkStatistics.uplinkTXPower = crsfTxPowerStatesmW[crsftxpowerindex];
|
rxLinkStatistics.uplinkTXPower = crsfTxPowerStatesmW[crsftxpowerindex];
|
||||||
rxLinkStatistics.activeAntenna = linkStats->activeAntenna;
|
rxLinkStatistics.activeAntenna = linkStats->activeAntenna;
|
||||||
|
|
||||||
|
#ifdef USE_OSD
|
||||||
if (rxLinkStatistics.uplinkLQ > 0) {
|
if (rxLinkStatistics.uplinkLQ > 0) {
|
||||||
int16_t uplinkStrength; // RSSI dBm converted to %
|
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);
|
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)
|
else if (rxLinkStatistics.uplinkRSSI < osdConfig()->rssi_dbm_min)
|
||||||
uplinkStrength = 0;
|
uplinkStrength = 0;
|
||||||
lqTrackerSet(rxRuntimeConfig->lqTracker, scaleRange(uplinkStrength, 0, 99, 0, RSSI_MAX_VALUE));
|
lqTrackerSet(rxRuntimeConfig->lqTracker, scaleRange(uplinkStrength, 0, 99, 0, RSSI_MAX_VALUE));
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
lqTrackerSet(rxRuntimeConfig->lqTracker, 0);
|
lqTrackerSet(rxRuntimeConfig->lqTracker, 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
// This is not RC channels frame, update channel value but don't indicate frame completion
|
// This is not RC channels frame, update channel value but don't indicate frame completion
|
||||||
return RX_FRAME_PENDING;
|
return RX_FRAME_PENDING;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue