Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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 |
--- 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; } }
--- 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"