mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[hal] Ensure HAL status variables are initialized to zero (#3421)
HAL functions don't set the status variable on success, so it's possible to use the status variable in an uninitialized state.
This commit is contained in:
@@ -89,7 +89,7 @@ static uint8_t readRegister(Register reg);
|
||||
*/
|
||||
static void initializeAccelerometer() {
|
||||
hal::init::CheckInit();
|
||||
int32_t status;
|
||||
int32_t status = 0;
|
||||
|
||||
if (!accel) {
|
||||
accel.reset(tAccel::create(&status));
|
||||
|
||||
Reference in New Issue
Block a user