time code sanitizations

This commit is contained in:
Klaus K Wilting 2019-02-09 14:21:09 +01:00
parent a46b16aa5d
commit 46f41d0ee8
5 changed files with 11 additions and 12 deletions

View File

@ -21,8 +21,8 @@ void sync_rtctime(void);
time_t get_rtctime(void);
float get_rtctemp(void);
void IRAM_ATTR CLOCKIRQ();
int pps_init(uint32_t pps_freq);
void pps_start();
int timepulse_init(uint32_t pps_freq);
void timepulse_start();
uint8_t sync_clock(time_t t);
#endif // _RTCTIME_H

View File

@ -15,8 +15,8 @@
;env_default = ttgov2
;env_default = ttgov21old
;env_default = ttgov21new
;env_default = ttgobeam
env_default = ttgofox
env_default = ttgobeam
;env_default = ttgofox
;env_default = lopy
;env_default = lopy4
;env_default = fipy
@ -223,7 +223,6 @@ build_flags =
upload_protocol = ${common.upload_protocol}
extra_scripts = ${common.extra_scripts}
monitor_speed = ${common.monitor_speed}
upload_port = COM61
[env:ttgobeam]
platform = ${common.platform_espressif32}
@ -235,7 +234,7 @@ lib_deps =
${common.lib_deps_basic}
${common.lib_deps_lora}
${common.lib_deps_gps}
; ${common.lib_deps_display}
${common.lib_deps_display}
build_flags =
${common.build_flags_all}
-mfix-esp32-psram-cache-issue

View File

@ -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

View File

@ -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

View File

@ -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