Relay: In free(), set both forward and reverse to 0.

Also, check status in between the two calls.

Change-Id: I5a6c24aefde3707a953a41cb7c56e8fb372e1ea0
This commit is contained in:
Peter Johnson
2014-10-06 00:31:46 -07:00
parent 2f26361398
commit a65cb500fb

View File

@@ -188,7 +188,8 @@ public class Relay extends SensorBase implements LiveWindowSendable {
status.order(ByteOrder.LITTLE_ENDIAN);
RelayJNI.setRelayForward(m_port, (byte) 0, status.asIntBuffer());
RelayJNI.setRelayForward(m_port, (byte) 0, status.asIntBuffer());
HALUtil.checkStatus(status.asIntBuffer());
RelayJNI.setRelayReverse(m_port, (byte) 0, status.asIntBuffer());
HALUtil.checkStatus(status.asIntBuffer());
DIOJNI.freeDIO(m_port, status.asIntBuffer());