mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Fixed current and potential bugs caught by Coverity
Change-Id: I9f9d09dc797ffea062eeb49c881be1d5acb63d7b
This commit is contained in:
committed by
Peter Johnson
parent
b0fec4089b
commit
055ee09825
@@ -10,6 +10,7 @@
|
||||
#include "NetworkCommunication/LoadOut.h"
|
||||
#include "WPIErrors.h"
|
||||
#include "HAL/HAL.hpp"
|
||||
#include "HAL/Port.h"
|
||||
|
||||
const uint32_t SensorBase::kDigitalChannels;
|
||||
const uint32_t SensorBase::kAnalogInputs;
|
||||
@@ -36,6 +37,7 @@ SensorBase::SensorBase() {
|
||||
int32_t status = 0;
|
||||
m_digital_ports[i] = initializeDigitalPort(port, &status);
|
||||
wpi_setErrorWithContext(status, getHALErrorMessage(status));
|
||||
freePort(port);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < kRelayChannels; i++) {
|
||||
@@ -43,6 +45,7 @@ SensorBase::SensorBase() {
|
||||
int32_t status = 0;
|
||||
m_relay_ports[i] = initializeDigitalPort(port, &status);
|
||||
wpi_setErrorWithContext(status, getHALErrorMessage(status));
|
||||
freePort(port);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < kPwmChannels; i++) {
|
||||
@@ -50,6 +53,7 @@ SensorBase::SensorBase() {
|
||||
int32_t status = 0;
|
||||
m_pwm_ports[i] = initializeDigitalPort(port, &status);
|
||||
wpi_setErrorWithContext(status, getHALErrorMessage(status));
|
||||
freePort(port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user