Skip to content

Commit

Permalink
Fixed function prototype declaration
Browse files Browse the repository at this point in the history
Only function prototypes may have default and optional parameters declared, the functions themselves may not as some compilers do not allow that
  • Loading branch information
SV-Zanshin committed Jul 31, 2017
1 parent 531d148 commit 51e5394
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Cubigel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 //
Expand All @@ -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 //
Expand All @@ -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 //
Expand Down
2 changes: 2 additions & 0 deletions Cubigel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 **
Expand Down

0 comments on commit 51e5394

Please sign in to comment.