The field version of the solarnano grid on the ionQubes
Fork of SolarNanoGridv3 by
Revision 36:a5620262f296, committed 2016-09-06
- Comitter:
- defrost
- Date:
- Tue Sep 06 06:08:56 2016 +0000
- Parent:
- 35:ede6d8bad011
- Commit message:
- Turned off the charge rate update from hub
Changed in this revision
Battery/Battery.cpp | Show annotated file Show diff for this revision Revisions of this file |
Battery/Battery.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r ede6d8bad011 -r a5620262f296 Battery/Battery.cpp --- a/Battery/Battery.cpp Wed Aug 03 12:51:48 2016 +0000 +++ b/Battery/Battery.cpp Tue Sep 06 06:08:56 2016 +0000 @@ -271,16 +271,18 @@ case ('M'): { - - sscanf (&dataRx[2],"%f",&maxChargeRate ); - if(maxChargeRate>2.0f) { - maxChargeRate=2.0f; - } - if (maxChargeRate<0.0f) { - maxChargeRate=0.0f; - } - DBG ("Max charge %f",maxChargeRate); - + #ifdef USEHUBCHARGERATE + sscanf (&dataRx[2],"%f",&maxChargeRate ); + if(maxChargeRate>2.0f) { + maxChargeRate=2.0f; + } + if (maxChargeRate<0.0f) { + maxChargeRate=0.0f; + } + DBG ("Max charge %f",maxChargeRate); + #else + DBG("Max charge rate being ignored..."); + #endif break; } }
diff -r ede6d8bad011 -r a5620262f296 Battery/Battery.h --- a/Battery/Battery.h Wed Aug 03 12:51:48 2016 +0000 +++ b/Battery/Battery.h Tue Sep 06 06:08:56 2016 +0000 @@ -26,6 +26,9 @@ #ifndef BATTERY_H #define BATTERY_H + +//#define USEHUBCHARGERATE // define this to use charge rate broadcast by the hub + #include <mbed.h> #include "NRF2401P.h" #include "nRF24l01.h"