[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:
Tyler Veness
2021-06-08 21:18:59 -07:00
committed by GitHub
parent d068fb321f
commit 0773f4033e
13 changed files with 13 additions and 22 deletions

View File

@@ -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));