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

Fix stick pos calcuation and OSD init order to make sure OSD displayport is initialized first

This commit is contained in:
Konstantin Sharlaimov (DigitalEntity) 2017-04-29 15:49:37 +10:00
parent 65aa69363a
commit 6944eeda10
2 changed files with 6 additions and 7 deletions

View file

@ -499,10 +499,6 @@ void init(void)
mspFcInit();
mspSerialInit();
#if defined(USE_MSP_DISPLAYPORT) && defined(CMS)
cmsDisplayPortRegister(displayPortMspInit());
#endif
#ifdef USE_CLI
cliInit(serialConfig());
#endif
@ -517,6 +513,10 @@ void init(void)
}
#endif
#if defined(USE_MSP_DISPLAYPORT) && defined(CMS)
cmsDisplayPortRegister(displayPortMspInit());
#endif
#ifdef GPS
if (feature(FEATURE_GPS)) {
gpsInit();

View file

@ -139,10 +139,9 @@ stickPositions_e getRcStickPositions(void)
bool checkStickPosition(stickPositions_e stickPos)
{
const uint8_t mask[4] = { 0x03, 0x0C, 0x30, 0xC0 };
for (int i = 0; i < 4; i++) {
const uint32_t mask = (0x03 << i);
const stickPositions_e checkPos = stickPos & mask;
if ((checkPos != 0) && (checkPos != (rcStickPositions & mask))) {
if (((stickPos & mask[i]) != 0) && ((stickPos & mask[i]) != (rcStickPositions & mask[i]))) {
return false;
}
}