@@ -138,10 +138,11 @@ void EEPROMStore::displayContents()
138138 LOG (DEBUG_INFO, " [EEPROM]: Stored Longitude: %s" , getLongitude ().ToString ());
139139 LOG (DEBUG_INFO, " [EEPROM]: Stored Pitch Calibration Angle: %f" , getPitchCalibrationAngle ());
140140 LOG (DEBUG_INFO, " [EEPROM]: Stored Roll Calibration Angle: %f" , getRollCalibrationAngle ());
141- LOG (DEBUG_INFO, " [EEPROM]: Stored RA Parking Position : %l" , getRAParkingPos ());
142- LOG (DEBUG_INFO, " [EEPROM]: Stored DEC Parking Position : %l" , getDECParkingPos ());
141+ LOG (DEBUG_INFO, " [EEPROM]: Stored RA Homing Offset : %l" , getRAHomingOffset ());
142+ LOG (DEBUG_INFO, " [EEPROM]: Stored DEC Homing Offset : %l" , getDECHomingOffset ());
143143 LOG (DEBUG_INFO, " [EEPROM]: Stored DEC Lower Limit: %l" , getDECLowerLimit ());
144144 LOG (DEBUG_INFO, " [EEPROM]: Stored DEC Upper Limit: %l" , getDECUpperLimit ());
145+ LOG (DEBUG_INFO, " [EEPROM]: Stored Last Flashed Version: %d" , getLastFlashedVersion ());
145146#endif
146147}
147148
@@ -412,7 +413,7 @@ float EEPROMStore::getRAStepsPerDegree()
412413void EEPROMStore::storeRAStepsPerDegree (float raStepsPerDegree)
413414{
414415 // Store steps as 100x steps/deg at 256 MS.
415- const float factor = SteppingStorageNormalized / RA_TRACKING_MICROSTEPPING ;
416+ const float factor = SteppingStorageNormalized / RA_SLEW_MICROSTEPPING ;
416417 int32_t val = raStepsPerDegree * factor;
417418 LOG (DEBUG_EEPROM, " [EEPROM]: Storing RA steps to %l (%f)" , val, raStepsPerDegree);
418419
@@ -430,7 +431,7 @@ float EEPROMStore::getDECStepsPerDegree()
430431 if (isPresentExtended (DEC_NORM_STEPS_MARKER_FLAG))
431432 {
432433 // This version stored 100x steps/deg for 256 MS
433- const float factor = SteppingStorageNormalized / DEC_GUIDE_MICROSTEPPING ;
434+ const float factor = SteppingStorageNormalized / DEC_SLEW_MICROSTEPPING ;
434435 decStepsPerDegree = readInt32 (DEC_NORM_STEPS_DEGREE_ADDR) / factor;
435436 LOG (DEBUG_EEPROM, " [EEPROM]: DEC Normed Marker Present! DEC steps/deg is %f" , decStepsPerDegree);
436437 }
@@ -451,7 +452,7 @@ float EEPROMStore::getDECStepsPerDegree()
451452// Store the DEC steps per degree for guiding (actually microsteps per degree).
452453void EEPROMStore::storeDECStepsPerDegree (float decStepsPerDegree)
453454{
454- const float factor = SteppingStorageNormalized / DEC_GUIDE_MICROSTEPPING ;
455+ const float factor = SteppingStorageNormalized / DEC_SLEW_MICROSTEPPING ;
455456 int32_t val = decStepsPerDegree * factor;
456457 LOG (DEBUG_EEPROM, " [EEPROM]: Storing DEC steps to %l (%f)" , val, decStepsPerDegree);
457458
@@ -460,6 +461,30 @@ void EEPROMStore::storeDECStepsPerDegree(float decStepsPerDegree)
460461 commit (); // Complete the transaction
461462}
462463
464+ int16_t EEPROMStore::getLastFlashedVersion ()
465+ {
466+ if (isPresentExtended (LAST_FLASHED_MARKER_FLAG))
467+ {
468+ // This version stored 100x steps/deg for 256 MS
469+ int16_t version = readInt16 (LAST_FLASHED_VERSION);
470+ LOG (DEBUG_EEPROM, " [EEPROM]: Last Flashed version Marker Present! last version %d" , version);
471+ return version;
472+ }
473+ else
474+ {
475+ LOG (DEBUG_EEPROM, " [EEPROM]: No stored value for Last Flashed Version" );
476+ }
477+ return 0 ;
478+ }
479+
480+ void EEPROMStore::storeLastFlashedVersion (int16_t version)
481+ {
482+ LOG (DEBUG_EEPROM, " [EEPROM]: Storing Last flashed version (%d)" , version);
483+ updateInt16 (LAST_FLASHED_VERSION, version);
484+ updateFlagsExtended (LAST_FLASHED_MARKER_FLAG);
485+ commit (); // Complete the transaction
486+ }
487+
463488// Return the Speed Factor scalar (dimensionless).
464489// If it is not present then the default uncalibrated value of 1.0 is returned.
465490float EEPROMStore::getSpeedFactor ()
@@ -652,68 +677,6 @@ void EEPROMStore::storeRollCalibrationAngle(float rollCalibrationAngle)
652677 commit (); // Complete the transaction
653678}
654679
655- // Return the stored RA Parking Pos (slew microsteps relative to home).
656- // If it is not present then the default value of 0 steps.
657- int32_t EEPROMStore::getRAParkingPos ()
658- {
659- int32_t raParkingPos (0 ); // microsteps (slew)
660-
661- // Note that flags doesn't verify that _both_ RA & DEC parking have been written - these should always be stored as a pair
662- if (isPresentExtended (PARKING_POS_MARKER_FLAG))
663- {
664- raParkingPos = readInt32 (RA_PARKING_POS_ADDR);
665- LOG (DEBUG_EEPROM, " [EEPROM]: RA Parking position read as %l" , raParkingPos);
666- }
667- else
668- {
669- LOG (DEBUG_EEPROM, " [EEPROM]: No stored value for Parking position" );
670- }
671-
672- return raParkingPos; // microsteps (slew)
673- }
674-
675- // Store the configured RA Parking Pos (slew microsteps relative to home).
676- void EEPROMStore::storeRAParkingPos (int32_t raParkingPos)
677- {
678- LOG (DEBUG_EEPROM, " [EEPROM]: Updating RA Parking Pos to %l" , raParkingPos);
679-
680- // Note that flags doesn't verify that _both_ RA & DEC parking have been written - these should always be stored as a pair
681- updateInt32 (RA_PARKING_POS_ADDR, raParkingPos);
682- updateFlagsExtended (PARKING_POS_MARKER_FLAG);
683- commit (); // Complete the transaction
684- }
685-
686- // Return the stored DEC Parking Pos (slew microsteps relative to home).
687- // If it is not present then the default value of 0 steps.
688- int32_t EEPROMStore::getDECParkingPos ()
689- {
690- int32_t decParkingPos (0 ); // microsteps (slew)
691-
692- // Note that flags doesn't verify that _both_ RA & DEC parking have been written - these should always be stored as a pair
693- if (isPresentExtended (PARKING_POS_MARKER_FLAG))
694- {
695- decParkingPos = readInt32 (DEC_PARKING_POS_ADDR);
696- LOG (DEBUG_EEPROM, " [EEPROM]: DEC Parking position read as %l" , decParkingPos);
697- }
698- else
699- {
700- LOG (DEBUG_EEPROM, " [EEPROM]: No stored value for Parking position" );
701- }
702-
703- return decParkingPos; // microsteps (slew)
704- }
705-
706- // Store the configured DEC Parking Pos (slew microsteps relative to home).
707- void EEPROMStore::storeDECParkingPos (int32_t decParkingPos)
708- {
709- LOG (DEBUG_EEPROM, " [EEPROM]: Updating DEC Parking Pos to %l" , decParkingPos);
710-
711- // Note that flags doesn't verify that _both_ RA & DEC parking have been written - these should always be stored as a pair
712- updateInt32 (DEC_PARKING_POS_ADDR, decParkingPos);
713- updateFlagsExtended (PARKING_POS_MARKER_FLAG);
714- commit (); // Complete the transaction
715- }
716-
717680// Return the stored DEC Lower Limit (slew microsteps relative to home).
718681// If it is not present then the default value of 0 steps (limits are disabled).
719682float EEPROMStore::getDECLowerLimit ()
0 commit comments