time code sanitizations
This commit is contained in:
1 parent
a46b16aa5d
commit
46f41d0ee8
5 files changed
+11
-12
No files matched your search
+2
-2
@@ -50,9 +50,9 @@ int dcf77_init(void) {
|
||||
|
||||
assert(ClockTask); // has clock task started?
|
||||
|
||||
pps_init(PPS); // setup pulse
|
||||
timepulse_init(PPS); // setup pulse
|
||||
DCF_Out(sync_clock(now())); // sync DCF time on next second
|
||||
pps_start(); // start pulse
|
||||
timepulse_start(); // start pulse
|
||||
|
||||
return 1; // success
|
||||
} // ifdcf77_init
|
||||
|
||||
+2
-2
@@ -120,8 +120,8 @@ int if482_init(void) {
|
||||
|
||||
assert(ClockTask); // has clock task started?
|
||||
|
||||
pps_init(PPS); // setup pulse
|
||||
pps_start(); // start pulse
|
||||
timepulse_init(PPS); // setup pulse
|
||||
timepulse_start(); // start pulse
|
||||
|
||||
return 1; // success
|
||||
} // if482_init
|
||||
|
||||
+2
-2
@@ -103,7 +103,7 @@ float get_rtctemp(void) {
|
||||
#endif // HAS_RTC
|
||||
|
||||
// helper function to setup a pulse for time synchronisation
|
||||
int pps_init(uint32_t pulse_period_ms) {
|
||||
int timepulse_init(uint32_t pulse_period_ms) {
|
||||
|
||||
// use time pulse from GPS as time base with fixed 1Hz frequency
|
||||
#if defined GPS_INT && defined GPS_CLK
|
||||
@@ -150,7 +150,7 @@ int pps_init(uint32_t pulse_period_ms) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void pps_start() {
|
||||
void timepulse_start() {
|
||||
#ifdef GPS_INT // start external clock
|
||||
attachInterrupt(digitalPinToInterrupt(GPS_INT), CLOCKIRQ, RISING);
|
||||
#elif defined RTC_INT // start external clock
|
||||
|
||||
Reference in new issue
Block a user