From 51e53944dfc690be78be98f2c302a864fbf6c7cd Mon Sep 17 00:00:00 2001 From: Arnd Date: Mon, 31 Jul 2017 09:00:53 +0200 Subject: [PATCH] Fixed function prototype declaration Only function prototypes may have default and optional parameters declared, the functions themselves may not as some compilers do not allow that --- Cubigel.cpp | 6 +++--- Cubigel.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cubigel.cpp b/Cubigel.cpp index cc95ecb..1a108ea 100644 --- a/Cubigel.cpp +++ b/Cubigel.cpp @@ -106,7 +106,7 @@ void CubigelClass::TimerHandler() { // ** the statistics are reset after this call, but the optional resetReading parameter can override this setting ** *******************************************************************************************************************/ uint16_t CubigelClass::readValues(const uint8_t idx,uint16_t &RPM,uint16_t &mA,// // - const bool resetReadings=true) { // // + const bool resetReadings) { // // if (idx>=deviceCount) return 0; // just return nothing if invalid // cli(); // Disable interrupts // RPM = devices[idx].totalRPM/devices[idx].readings; // set the averaged RPM value // @@ -128,7 +128,7 @@ uint16_t CubigelClass::readValues(const uint8_t idx,uint16_t &RPM,uint16_t &mA,/ *******************************************************************************************************************/ uint16_t CubigelClass::readValues(const uint8_t idx,uint16_t &RPM,uint16_t &mA,// // uint16_t &commsErrors, uint16_t errorStatus,// // - const bool resetReadings=true) { // // + const bool resetReadings) { // // if (idx>=deviceCount) return 0; // just return nothing if invalid // cli(); // Disable interrupts // RPM = devices[idx].totalRPM/devices[idx].readings; // set the averaged RPM value // @@ -150,7 +150,7 @@ uint16_t CubigelClass::readValues(const uint8_t idx,uint16_t &RPM,uint16_t &mA,/ ** function setMode() is called to set which mode the Cubigel outputs data in. The default mode, MODE_DEFAULT, ** ** outputs the message type 76 which contains the compressor speed and current consumption. ** *******************************************************************************************************************/ -void CubigelClass::setMode(const uint8_t idx, const uint8_t mode=0) { // Set Cubigel FDC1 mode // +void CubigelClass::setMode(const uint8_t idx, const uint8_t mode) { // Set Cubigel FDC1 mode // uint8_t modeByte = 0; // Byte to set state, default is 0 // if (mode==1) modeByte = 192; // Mode 0 is the default // if (idx>=deviceCount) return 0; // just return nothing if invalid // diff --git a/Cubigel.h b/Cubigel.h index 47dcba3..2645fbb 100644 --- a/Cubigel.h +++ b/Cubigel.h @@ -31,6 +31,8 @@ ** ** ** Vers. Date Developer Comments ** ** ====== ========== =================== ======================================================================== ** +** 1.0.1 2017-07-31 Arnd@SV-Zanshin.Com Prototypes contain optional parameter definitions, functions no longer ** +** have them declared as non-Windows compilers fail when they do ** ** 1.0.0 2017-04-19 Arnd@SV-Zanshin.Com Cleaned up debugging code and ready for first release ** ** 1.0.b1 2017-04-18 Arnd@SV-Zanshin.Com Added support for hardware serial in addition to software serial ** ** 1.0.b2 2017-02-21 Arnd@SV-Zanshin.Com Initial coding **