diff --git a/src/eeprom_avr.cpp b/src/eeprom_avr.cpp index 0374dde36..f0ffd45f0 100644 --- a/src/eeprom_avr.cpp +++ b/src/eeprom_avr.cpp @@ -349,7 +349,7 @@ uint16_t RlcFile::readRlc(uint8_t *buf,uint16_t i_len) { uint16_t i=0; for( ; 1; ){ - uint8_t l=min(m_zeroes,i_len-i); + uint8_t l = min(m_zeroes,i_len-i); memclear(&buf[i], l); i += l; m_zeroes -= l; @@ -736,7 +736,7 @@ void RlcFile::nextRlcWriteStep() { uint8_t fri=0; - if (m_currBlk && ( fri = EeFsGetLink(m_currBlk))) { + if (m_currBlk && (fri=EeFsGetLink(m_currBlk))) { uint8_t prev_freeList = eeFs.freeList; eeFs.freeList = fri; while( EeFsGetLink(fri)) fri = EeFsGetLink(fri); @@ -859,9 +859,7 @@ void eeLoadModel(uint8_t id) } if (pulsesStarted()) { - checkLowEEPROM(); - checkTHR(); - checkSwitches(); + checkAll(); resumePulses(); clearKeyEvents(); } diff --git a/src/open9x.cpp b/src/open9x.cpp index fdd6783bb..8234d582f 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -941,7 +941,7 @@ void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t val = (val * 46) / 25; } #endif - lcd_outdezAtt(x, (att & DBLSIZE ? y - FH : y), val, att & (~NO_UNIT)); // TODO we could add this test inside lcd_outdezAtt! + lcd_outdezAtt(x, (att & DBLSIZE ? y - FH : y), val, att & (~NO_UNIT)); if (~att & NO_UNIT && unit != UNIT_RAW) lcd_putsiAtt(lcdLastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0); } @@ -1076,6 +1076,16 @@ void doSplash() #define doSplash() #endif +void checkAll() +{ +#if !defined(PCBARM) + checkLowEEPROM(); +#endif + + checkTHR(); + checkSwitches(); +} + #if !defined(PCBARM) void checkLowEEPROM() { @@ -3218,12 +3228,7 @@ inline void open9xInit(OPEN9X_INIT_ARGS) } #endif -#if !defined(PCBARM) - checkLowEEPROM(); -#endif - - checkTHR(); - checkSwitches(); + checkAll(); checkAlarm(); } diff --git a/src/open9x.h b/src/open9x.h index b2c31811f..1f978d5f4 100644 --- a/src/open9x.h +++ b/src/open9x.h @@ -682,6 +682,7 @@ void checkLowEEPROM(); void checkTHR(); void checkSwitches(); void checkAlarm(); +void checkAll(); #define ADC_VREF_TYPE 0x40 // AVCC with external capacitor at AREF pin