From ad6c8b882e85bab2bd591c8aae72e51375228e4d Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Mon, 31 Aug 2020 00:31:30 -0700 Subject: [PATCH] [hal] Fix PDP Energy Calculation (#2672) Fixes #2642 --- hal/src/main/native/athena/PDP.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hal/src/main/native/athena/PDP.cpp b/hal/src/main/native/athena/PDP.cpp index f5cf92b687..bf0cedf2b1 100644 --- a/hal/src/main/native/athena/PDP.cpp +++ b/hal/src/main/native/athena/PDP.cpp @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */ +/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -438,7 +438,7 @@ double HAL_GetPDPTotalEnergy(HAL_PDPHandle handle, int32_t* status) { energyJoules *= pdpStatus.bits .TmeasMs_likelywillbe20ms_; /* multiplied by TmeasMs = joules */ - return 0.125 * raw; + return energyJoules; } void HAL_ResetPDPTotalEnergy(HAL_PDPHandle handle, int32_t* status) {