From b205f3e1b4d4d8df0ac25d71453e46fc7d2a6e31 Mon Sep 17 00:00:00 2001 From: Thad House Date: Sun, 1 Jun 2025 22:23:51 -0700 Subject: [PATCH] [hal] Add temp value for HAL_GetUserVoltage3V3 (#8001) Lots of higher level code in allwpilib depends on this, so we should return at least a valid and sane value, rather then erroring. --- hal/src/main/native/systemcore/Power.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hal/src/main/native/systemcore/Power.cpp b/hal/src/main/native/systemcore/Power.cpp index 08ecbd2d94..5fb5f80c01 100644 --- a/hal/src/main/native/systemcore/Power.cpp +++ b/hal/src/main/native/systemcore/Power.cpp @@ -55,8 +55,9 @@ double HAL_GetVinVoltage(int32_t* status) { double HAL_GetUserVoltage3V3(int32_t* status) { initializePower(status); - *status = HAL_HANDLE_ERROR; - return 0; + // Until we have a value, make this work, as lots of other + // code depends on it. + return 3.3; } double HAL_GetUserCurrent3V3(int32_t* status) {