From bac9540d521d8fbc1fab9b64c4adfb1401d009c4 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sat, 9 Feb 2019 15:46:44 +0100 Subject: [PATCH] code sanitizations --- include/payload.h | 2 +- src/dcf77.cpp | 11 +++++------ src/if482.cpp | 9 +++------ src/payload.cpp | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/payload.h b/include/payload.h index 24b5ece6..686a5b62 100644 --- a/include/payload.h +++ b/include/payload.h @@ -82,7 +82,7 @@ private: uint8_t cursor; #else -#error "No valid payload converter defined" +#error No valid payload converter defined! #endif }; diff --git a/src/dcf77.cpp b/src/dcf77.cpp index ac76948a..8be4ed61 100644 --- a/src/dcf77.cpp +++ b/src/dcf77.cpp @@ -9,7 +9,7 @@ https://www-user.tu-chemnitz.de/~heha/viewzip.cgi/hs/Funkuhr.zip/ #ifdef HAS_DCF77 #ifdef IF_482 -#error "You must define at most one of IF482 or DCF77" +#error You must define at most one of IF482 or DCF77! #endif #include "dcf77.h" @@ -50,9 +50,9 @@ int dcf77_init(void) { assert(ClockTask); // has clock task started? - timepulse_init(PPS); // setup pulse + timepulse_init(PPS); // setup pulse DCF_Out(sync_clock(now())); // sync DCF time on next second - timepulse_start(); // start pulse + timepulse_start(); // start pulse return 1; // success } // ifdcf77_init @@ -140,9 +140,8 @@ void dcf77_loop(void *pvParameters) { vTaskDelayUntil(&wakeTime, pdMS_TO_TICKS(DCF77_PULSE_DURATION)); } -#elif (PPS < DCF77_PULSE_DURATION) // we need downclocking - vTaskDelayUntil(&wakeTime, pdMS_TO_TICKS(DCF77_PULSE_DURATION - PPS)); - DCF_Out(0); +#elif (PPS < DCF77_PULSE_DURATION) // we need downclocking, not yet implemented +#error Timepulse is too low for DCF77! #endif } // for } // dcf77_loop() diff --git a/src/if482.cpp b/src/if482.cpp index 759d863e..97aff8c4 100644 --- a/src/if482.cpp +++ b/src/if482.cpp @@ -80,7 +80,7 @@ not evaluated by model BU-190 #ifdef HAS_IF482 #ifdef HAS_DCF77 -#error "You must define at most one of IF482 or DCF77" +#error You must define at most one of IF482 or DCF77! #endif #include "if482.h" @@ -100,7 +100,6 @@ static const char TAG[] = "main"; #define PPS IF482_PULSE_DURATION #endif - HardwareSerial IF482(2); // use UART #2 (note: #1 may be in use for serial GPS) // initialize and configure IF482 Generator @@ -191,10 +190,8 @@ void if482_loop(void *pvParameters) { IF482.print(IF482_Out(now() + 1)); } -#elif (PPS < IF482_PULSE_DURATION) // we need downclocking - IF482.print(IF482_Out(now() + 1)); - vTaskDelayUntil(&wakeTime, - shotTime - PPS); // sets waketime to moment of shot +#elif (PPS < IF482_PULSE_DURATION) // we need downclocking, not yet implemented +#error Timepulse is too low for IF482! #endif } } // if482_loop() diff --git a/src/payload.cpp b/src/payload.cpp index 71534a24..eebe88d7 100644 --- a/src/payload.cpp +++ b/src/payload.cpp @@ -437,5 +437,5 @@ void PayloadConvert::addButton(uint8_t value) { } #else -#error "No valid payload converter defined" +#error No valid payload converter defined! #endif \ No newline at end of file