Skip to content

Commit cea7669

Browse files
V1.8.50 - Updates
- Really fixed the EEPROM bug this time. No, really. I promise.
1 parent 7935ee8 commit cea7669

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define VERSION "V1.8.49"
1+
#define VERSION "V1.8.50"

Software/Arduino code/OpenAstroTracker/src/Mount.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,20 +346,20 @@ void Mount::writePersistentData(int which, long val)
346346
bool writeExtended = false;
347347

348348
// If we're written something before...
349-
uint16_t magicMarker = EPROMStore::read(5) * 256 + EPROMStore::read(4);
349+
uint16_t magicMarker = (EPROMStore::read(5) << 8) + EPROMStore::read(4);
350350
LOGV3(DEBUG_INFO|DEBUG_EEPROM,F("Mount: EEPROM Write(%d): Marker is %x"), which, magicMarker);
351351
if ((magicMarker & EEPROM_MAGIC_MASK) == EEPROM_MAGIC_MARKER) {
352352
// ... read the current state ...
353353
flag = EPROMStore::read(4);
354354
if ((magicMarker & EEPROM_MAGIC_EXTENDED_MASK) == EEPROM_MAGIC_EXTENDED_MARKER) {
355355
extendedFlag = EPROMStore::readInt16(21, 22);
356-
LOGV3(DEBUG_INFO|DEBUG_EEPROM,F("Mount: EEPROM Write: Marker is 0xBF, extended flag is %x (%d)"), extendedFlag, extendedFlag);
356+
LOGV4(DEBUG_INFO|DEBUG_EEPROM,F("Mount: EEPROM Write: Marker is 0xBF, flag is %x, extended flag is %x (%d)"), flag, extendedFlag, extendedFlag);
357357
}
358358
else{
359359
LOGV3(DEBUG_INFO|DEBUG_EEPROM,F("Mount: EEPROM Write: Marker is 0xBE, flag is %x (%d)"), flag, flag);
360360
}
361361
}
362-
362+
363363
switch (which) {
364364
case EEPROM_RA:
365365
{

0 commit comments

Comments
 (0)