code/WPILib/DigitalModule.cpp
/**
 * Set the state of a relay.
 * Set the state of a relay output to be forward. Relays have two outputs and each is
 * independently set to 0v or 12v.
 */
Set the state of a relay.
Set the state of a relay output to be forward. Relays have two outputs and each is
independently set to 0v or 12v.
Set the state of a relay . Set the state of a relay output to be forward . Relays have two outputs and each is independently set to 0v or 12v .
void DigitalModule::SetRelayForward(UINT32 channel, bool on)
{
	status = 0;
	CheckRelayChannel(channel);
	{
		Synchronized sync(m_relaySemaphore);
		UINT8 forwardRelays = m_fpgaDIO->readSlowValue_RelayFwd(&status);
		if (on)
			forwardRelays |= 1 << (channel - 1);
		else
			forwardRelays &= ~(1 << (channel - 1));
		m_fpgaDIO->writeSlowValue_RelayFwd(forwardRelays, &status);
	}
	wpi_assertCleanStatus(status);
}
void DigitalModule :: SetRelayForward ( UINT32 channel , bool on ) { status = 0 ; CheckRelayChannel ( channel ) ; { Synchronized sync ( m_relaySemaphore ) ; UINT8 forwardRelays = m_fpgaDIO -> readSlowValue_RelayFwd ( & status ) ; if ( on ) forwardRelays |= 1 << ( channel - 1 ) ; else forwardRelays &= ~ ( 1 << ( channel - 1 ) ) ; m_fpgaDIO -> writeSlowValue_RelayFwd ( forwardRelays , & status ) ; } wpi_assertCleanStatus ( status ) ; }
Set the state of a relay.
Set the state of a relay .