28 static unsigned int count;
29 static bool syncingStatus = 1;
31 if (1 == syncingStatus)
123 if (1 == startDir && 1 == stopDir)
128 else if (0 == startDir && 0 == stopDir)
133 else if (1 == startDir && 0 == stopDir)
138 else if (0 == startDir && 1 == stopDir)
205 unsigned int onesMinute = 0;
206 for(i = 21; i <= 27; i++)
214 onesMinute = onesMinute + (int)
bitArray[28];
230 unsigned int onesHour = 0;
231 for(j = 29; j <= 34; j++)
239 onesHour = onesHour + (int)
bitArray[35];
264 static const unsigned int bcdValues[] = {1, 2, 4, 8, 10, 20, 40, 80};
266 volatile unsigned int minuteTemp = 0;
267 volatile unsigned int hourTemp = 0;
274 for(i = 21; i <= 27; i++)
276 minuteTemp = minuteTemp + (bcdValues[i-21] *
bitArray[i]);
290 for(i = 29; i <= 34; i++)
292 hourTemp = hourTemp + (bcdValues[i-29] *
bitArray[i]);
unsigned int testbitTimeCyclesStart
bool bitValue(unsigned int bitTime)
Determine the bit value of the transmitted DCF77 bit and return it, gets called from interruptDcf()
void storeBit(bool bit, unsigned int location)
Store the received DCF77 bit in the array, gets called from interruptDcf()
bool checkBitStream()
Checks if certain predetermined bits are 1 or 0 and if parity of minute and hour is correct,...
unsigned int calculateBitTransmitTime(bool checkSyncStatus, unsigned int start, bool startDir, unsigned int stop, bool stopDir)
Calculate the bit time of the DCF77 pulses, gets called from interruptDcf()
void decodeBitStream2Seconds()
Decode the received DCF77 bitstream to a time, gets called from interruptDcf() Also ensure that the r...
unsigned int testbitTimeCyclesStartLower
void interruptDcf()
Time the DCF77 pulses gets called from pin interrupt port1ISR(void)
unsigned int testbitTimeCyclesStartUpper
volatile unsigned int hourDcfLast
bool countingDirectionEnd
#define bitTimeCyclesSync
bool countingDirectionStart
uint32_t countDcf77Messages
volatile unsigned int minuteDcfLast
#define bitTimeCycles1Upper
#define bitTimeCycles0Upper
bool interruptEdgeToggleDcf
#define bitTimeCyclesSyncLower
#define bitTimeCycles1Lower
#define bitTimeCyclesSyncUpper
#define bitTimeCycles0Lower
uint32_t timeOfLastDcfMessage
uint32_t timeSinceLastCompleteDcfMessage
double mechanicalTimeFloat
volatile bool toggleTimer1Direction
void UART_SendInt(int32_t num)
send a 16 bit integer to host system
void UART_Bitstream(const bool *arr, unsigned int length)
Sends a the received DCF bitstream to host system.
void UART_SendTime(uint32_t seconds)
Sends a time formated in hours and minutes to host system.
void UART_SendString(char *str)
send a full string to host system