1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-19 09:54:15 +01:00

Merge remote-tracking branch 'revo/amorale/revo' into revo

This commit is contained in:
James Cotton 2012-05-28 20:27:51 -05:00
commit 88cf100430
2 changed files with 2 additions and 4 deletions

View File

@ -86,7 +86,7 @@ static void onTimer(UAVObjEvent* ev)
static FlightBatteryStateData flightBatteryData;
FlightBatterySettingsData batterySettings;
static float dT = SAMPLE_PERIOD_MS / 1000;
static float dT = SAMPLE_PERIOD_MS / 1000.0;
float energyRemaining;
FlightBatterySettingsGet(&batterySettings);
@ -95,8 +95,7 @@ static void onTimer(UAVObjEvent* ev)
flightBatteryData.Voltage = ((float)PIOS_ADC_PinGet(0)) * batterySettings.SensorCalibrations[FLIGHTBATTERYSETTINGS_SENSORCALIBRATIONS_VOLTAGEFACTOR]; //in Volts
flightBatteryData.Current = ((float)PIOS_ADC_PinGet(1)) * batterySettings.SensorCalibrations[FLIGHTBATTERYSETTINGS_SENSORCALIBRATIONS_CURRENTFACTOR]; //in Amps
flightBatteryData.ConsumedEnergy += (flightBatteryData.Current * 1000.0 * dT / 3600.0) ;//in mAh
flightBatteryData.ConsumedEnergy += (flightBatteryData.Current * 1000.0f * dT / 3600.0f) ;//in mAh
if (flightBatteryData.Current > flightBatteryData.PeakCurrent)flightBatteryData.PeakCurrent = flightBatteryData.Current; //in Amps
flightBatteryData.AvgCurrent=(flightBatteryData.AvgCurrent*0.8)+(flightBatteryData.Current*0.2); //in Amps

View File

@ -50,7 +50,6 @@
#include "accels.h"
#include "attitudeactual.h"
#include "pathdesired.h" // object that will be updated by the module
#include "positiondesired.h" // object that will be updated by the module
#include "positionactual.h"
#include "manualcontrol.h"
#include "flightstatus.h"