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.
Dependencies: SPI_TFTx2_ILI9341 TFT_fonts TOUCH_TFTx2_ILI9341 mbed
Fork of CANary_corrupt by
Revision 201:4adbb1b56005, committed 2015-01-23
- Comitter:
- TickTock
- Date:
- Fri Jan 23 15:08:24 2015 +0000
- Parent:
- 200:b2d21dcd6287
- Child:
- 202:4df5351a1e13
- Commit message:
- // * Freeze mpkWh computation when car is at a standstill (avoid alarming wrong estimate when at a stop).;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Sep 25 03:14:10 2014 +0000
+++ b/main.cpp Fri Jan 23 15:08:24 2015 +0000
@@ -12,8 +12,8 @@
// * fix bug where charging while on screws up efficiency computation
// * find better kWh estimate than gids
-// rev200
-// Fixed brakeMon/regenMon mixup in config file
+// rev201
+// * Freeze mpkWh computation when car is at a standstill (avoid alarming wrong estimate when at a stop).
// Include this before other header files
#include "precompile.h"
@@ -27,7 +27,7 @@
#include "displayModes.h"
#include "TOUCH_TFTx2.h"
-char revStr[7] = "200";
+char revStr[7] = "201";
unsigned long maxTarget = 1000;
FATFS USBdrive;
LocalFileSystem local("local");
@@ -1167,7 +1167,8 @@
}
numWsamples=0;
- if(accOn&&!charging){ // Calculate averages
+ //if(accOn&&!charging){ // Calculate averages
+ if(moving){ // Calculate averages for DTE. Freeze when not moving.
for(i=1;i<39;i++){
average=mph[i]/timeConstant[i];
mph[i]-=average;
