DCF77+IF482 code sanitizations

This commit is contained in:
Klaus K Wilting 2019-02-07 23:11:10 +01:00
parent bad5805810
commit f319d669ec
2 changed files with 1 additions and 7 deletions

View File

@ -1,9 +1,6 @@
/* /*
// Emulate a DCF77 radio receiver // Emulate a DCF77 radio receiver
// //
// parts of this code werde adapted from source:
https://www.elektormagazine.com/labs/dcf77-emulator-with-esp8266-elektor-labs-version-150713
//
// a nice & free logic test program for DCF77 can be found here: // a nice & free logic test program for DCF77 can be found here:
https://www-user.tu-chemnitz.de/~heha/viewzip.cgi/hs/Funkuhr.zip/ https://www-user.tu-chemnitz.de/~heha/viewzip.cgi/hs/Funkuhr.zip/
// //
@ -25,7 +22,6 @@ uint8_t DCFtimeframe[DCF77_FRAME_SIZE];
// initialize and configure DCF77 output // initialize and configure DCF77 output
int dcf77_init(void) { int dcf77_init(void) {
time_t t, tt;
BitsPending = false; BitsPending = false;
pinMode(HAS_DCF77, OUTPUT); pinMode(HAS_DCF77, OUTPUT);

View File

@ -152,7 +152,6 @@ void if482_loop(void *pvParameters) {
configASSERT(((uint32_t)pvParameters) == 1); // FreeRTOS check configASSERT(((uint32_t)pvParameters) == 1); // FreeRTOS check
TickType_t wakeTime; TickType_t wakeTime;
time_t t, tt;
const TickType_t timeOffset = const TickType_t timeOffset =
pdMS_TO_TICKS(IF482_OFFSET); // duration of telegram transmit pdMS_TO_TICKS(IF482_OFFSET); // duration of telegram transmit
const TickType_t startTime = xTaskGetTickCount(); // now const TickType_t startTime = xTaskGetTickCount(); // now
@ -172,8 +171,7 @@ void if482_loop(void *pvParameters) {
portMAX_DELAY); // wait forever (missing error handling here...) portMAX_DELAY); // wait forever (missing error handling here...)
#if !defined RTC_CLK || (RTC_CLK == IF482_PULSE_DURATION) // we don't need clock rescaling #if !defined RTC_CLK || (RTC_CLK == IF482_PULSE_DURATION) // we don't need clock rescaling
// now we're synced to start of second tt and wait // wait until it's time to start transmit telegram for next second
// until it's time to start transmit telegram for tt+1
vTaskDelayUntil(&wakeTime, shotTime); // sets waketime to moment of shot vTaskDelayUntil(&wakeTime, shotTime); // sets waketime to moment of shot
IF482.print(IF482_Out(now() + 1)); IF482.print(IF482_Out(now() + 1));