don't use uninitialized variables

Change-Id: I9869c3bf64f00ddff641e5dc06b16179c3b3ce2f
This commit is contained in:
Brian Silverman
2015-01-10 22:07:27 -08:00
committed by James Kuszmaul
parent d1d28e70e1
commit 880eae1424
2 changed files with 21 additions and 9 deletions

View File

@@ -760,6 +760,10 @@ void CANJaguar::verify()
message = LM_API_POS_PC;
else if(m_controlMode == kCurrent)
message = LM_API_ICTRL_PC;
else {
wpi_setWPIErrorWithContext(IncompatibleMode, "PID constants only apply in Speed, Position, and Current mode");
return;
}
if(getMessage(message, CAN_MSGID_FULL_M, dataBuffer, &dataSize))
{
@@ -788,6 +792,10 @@ void CANJaguar::verify()
message = LM_API_POS_IC;
else if(m_controlMode == kCurrent)
message = LM_API_ICTRL_IC;
else {
wpi_setWPIErrorWithContext(IncompatibleMode, "PID constants only apply in Speed, Position, and Current mode");
return;
}
if(getMessage(message, CAN_MSGID_FULL_M, dataBuffer, &dataSize))
{
@@ -816,6 +824,10 @@ void CANJaguar::verify()
message = LM_API_POS_DC;
else if(m_controlMode == kCurrent)
message = LM_API_ICTRL_DC;
else {
wpi_setWPIErrorWithContext(IncompatibleMode, "PID constants only apply in Speed, Position, and Current mode");
return;
}
if(getMessage(message, CAN_MSGID_FULL_M, dataBuffer, &dataSize))
{