Skip to content

Commit

Permalink
Maintain consistency, simplify logic, and change comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-mcelwain committed Sep 6, 2024
1 parent dee8820 commit a717abc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ControllerStatusIO.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ BOOL Ros_Controller_IsAlarm()

BOOL Ros_Controller_IsMajorAlarm()
{
return (g_Ros_Controller.ioStatus[IO_ROBOTSTATUS_ALARM_MAJOR] != 0);
return ((g_Ros_Controller.ioStatus[IO_ROBOTSTATUS_ALARM_MAJOR] != 0));
}

BOOL Ros_Controller_IsError()
Expand Down
8 changes: 5 additions & 3 deletions src/ServiceResetError.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ void Ros_ServiceResetError_Trigger(const void* request_msg, void* response_msg)
}
}

// Check for condition that can be fixed remotely
// Major alarms cannot be reset remotely
if (Ros_Controller_IsMajorAlarm())
{
rosidl_runtime_c__String__assign(&response->message, "Major alarm active. Cannot be reset. Check teach pendant");
response->result_code.value = MOTION_NOT_READY_MAJOR_ALARM;
goto DONE;
}
else if (Ros_Controller_IsAlarm())
}

// Other alarm types can be reset remotely
if (Ros_Controller_IsAlarm())
{
// Reset alarm
bzero(&rData, sizeof(rData));
Expand Down

0 comments on commit a717abc

Please sign in to comment.