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.
Revision 51:6187c5264a73, committed 2013-04-07
- Comitter:
- TickTock
- Date:
- Sun Apr 07 17:11:28 2013 +0000
- Parent:
- 50:83d5864c64a0
- Child:
- 52:d5385fbf4ea1
- Child:
- 53:6ce808d0995e
- Commit message:
- Fixed power accounting bug when in reverse (need to use absolute value of speed - dropping sign).
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| utility.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Apr 07 16:34:12 2013 +0000
+++ b/main.cpp Sun Apr 07 17:11:28 2013 +0000
@@ -155,7 +155,7 @@
t = *localtime(&seconds) ;
strftime(sTemp, 32, "%a %m/%d/%Y %X\n", &t);
logMsg(sTemp);
- sprintf(sTemp,"CANary firmware rev50\n");
+ sprintf(sTemp,"CANary firmware rev51\n");
logMsg(sTemp);
// Look for new binary on thumbdrive
--- a/utility.cpp Sun Apr 07 16:34:12 2013 +0000
+++ b/utility.cpp Sun Apr 07 17:11:28 2013 +0000
@@ -132,6 +132,9 @@
}
}else if((mType==1)&&(canRXmsg.id==0x1da)){ //Motor Speed
imotorRPM=((canRXmsg.data[4]<<8)|(canRXmsg.data[5]));
+ if(imotorRPM<0){ // take absolute value
+ imotorRPM=-imotorRPM;
+ }
motorRPM+=imotorRPM;
numSsamples++;
}
