21#define bitArrayLength 58
27#define bitTime0Sec 0.1
28#define bitTime1Sec 0.2
29#define bitTimeSyncSec 1.8
30#define bitTimeCyclesTresh 0.01
34#define bitTimeCycles0 ((clockFreq) * (bitTime0Sec))
35#define bitTimeCycles0Upper ((int)((bitTimeCycles0) + ((clockFreq) * (bitTimeCyclesTresh))))
36#define bitTimeCycles0Lower ((int)((bitTimeCycles0) - ((clockFreq) * (bitTimeCyclesTresh))))
38#define bitTimeCycles1 ((clockFreq) * (bitTime1Sec))
39#define bitTimeCycles1Upper ((int)((bitTimeCycles1) + ((clockFreq) * (bitTimeCyclesTresh))))
40#define bitTimeCycles1Lower ((int)((bitTimeCycles1) - ((clockFreq) * (bitTimeCyclesTresh))))
42#define bitTimeCyclesSync ((unsigned int)(clockFreq * bitTimeSyncSec))
43#define bitTimeCyclesSyncUpper ((unsigned int)(bitTimeCyclesSync + (clockFreq * bitTimeCyclesTresh)))
44#define bitTimeCyclesSyncLower ((unsigned int)(bitTimeCyclesSync - (clockFreq * bitTimeCyclesTresh)))
52unsigned int calculateBitTransmitTime(
bool checkSyncStatus,
unsigned int start,
bool startDir,
unsigned int stop,
bool stopDir);
54void storeBit(
bool bit,
unsigned int location);
volatile unsigned int hourDcfLast
bool countingDirectionEnd
bool bitValue(unsigned int bitTime)
Determine the bit value of the transmitted DCF77 bit and return it, gets called from interruptDcf()
bool countingDirectionStart
void storeBit(bool bit, unsigned int location)
Store the received DCF77 bit in the array, gets called from interruptDcf()
uint32_t countDcf77Messages
volatile unsigned int minuteDcfLast
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...
bool interruptEdgeToggleDcf
void interruptDcf()
Time the DCF77 pulses gets called from pin interrupt port1ISR(void)