handles the keeping and calculating of time of the system More...
Go to the source code of this file.
Functions | |
| void | calculateTimeDifference () |
| calculate the difference between the mechanical time and the current time to have the time difference which the stepper needs to be advanced with, gets called from end interrupt of ISR_TA0(void). | |
| uint32_t | calculateStepsToTake (uint32_t time) |
| Calculate the steps to take for a given time difference, gets called by calculateTimeDifference() | |
| void | resetTimeKeeping () |
| Reset the time settings on startup, gets called from main() | |
Variables | |
| bool | toggleCalculateTimeDifference = 1 |
handles the keeping and calculating of time of the system
Definition in file timeKeeping.c.
| uint32_t calculateStepsToTake | ( | uint32_t | time | ) |
Calculate the steps to take for a given time difference, gets called by calculateTimeDifference()
| time | the difference between time to advance the stepper with |
Definition at line 122 of file timeKeeping.c.
References stepsClockSecond.
| void calculateTimeDifference | ( | ) |
calculate the difference between the mechanical time and the current time to have the time difference which the stepper needs to be advanced with, gets called from end interrupt of ISR_TA0(void).
It then calculates the amount of steps that are needed to advance the clock to display the current time. The function take in to account which way it is the fastest to fully wrap the clock or to wait until the time synchronizes
Definition at line 26 of file timeKeeping.c.
References calculateStepsToTake(), clockWraparoundThresholdSec, countDcf77Messages, mechanicalTimeFloat, secondsInDay, stepsInDay, stepsRemaining, stepsToggleThreshold, timeOfLastDcfMessage, timerCompareStepperSpeedToggle, timeSinceLastCompleteDcfMessage, toggleCalculateTimeDifference, toggleFwdInterrupt, toggleFwdInterruptISR, and toggleInterruptDcf.
Referenced by ISR_TA0().
| void resetTimeKeeping | ( | ) |
Reset the time settings on startup, gets called from main()
Definition at line 142 of file timeKeeping.c.
References mechanicalTimeFloat, timeOfLastDcfMessage, and timeSinceLastCompleteDcfMessage.
Referenced by main().
| bool toggleCalculateTimeDifference = 1 |
Definition at line 16 of file timeKeeping.c.
Referenced by calculateTimeDifference(), ISR_TA0(), and stepperAdvance().