code/WPILib/Counter.cpp
/**
 * Set the source object that causes the counter to count down.
 * Set the down counting DigitalSource.
 */
Set the source object that causes the counter to count down.
Set the down counting DigitalSource.
Set the source object that causes the counter to count down . Set the down counting DigitalSource .
void Counter::SetDownSource(DigitalSource *source)
{
	if (m_allocatedDownSource)
	{
		delete m_downSource;
		m_downSource = NULL;
		m_allocatedDownSource = false;
	}
	unsigned char mode = m_counter->readConfig_Mode(&status);
	wpi_assert(mode == kTwoPulse || mode == kExternalDirection);
	m_downSource = source;
	m_counter->writeConfig_DownSource_Module(source->GetModuleForRouting(), &status);
	m_counter->writeConfig_DownSource_Channel(source->GetChannelForRouting(), &status);
	m_counter->writeConfig_DownSource_AnalogTrigger(source->GetAnalogTriggerForRouting(), &status);
	SetDownSourceEdge(true, false);
	m_counter->strobeReset(&status);
	wpi_assertCleanStatus(status);
}
void Counter :: SetDownSource ( DigitalSource * source ) { if ( m_allocatedDownSource ) { delete m_downSource ; m_downSource = NULL ; m_allocatedDownSource = false ; } unsigned char mode = m_counter -> readConfig_Mode ( & status ) ; wpi_assert ( mode == kTwoPulse || mode == kExternalDirection ) ; m_downSource = source ; m_counter -> writeConfig_DownSource_Module ( source -> GetModuleForRouting ( ) , & status ) ; m_counter -> writeConfig_DownSource_Channel ( source -> GetChannelForRouting ( ) , & status ) ; m_counter -> writeConfig_DownSource_AnalogTrigger ( source -> GetAnalogTriggerForRouting ( ) , & status ) ; SetDownSourceEdge ( true , false ) ; m_counter -> strobeReset ( & status ) ; wpi_assertCleanStatus ( status ) ; }
Set the source object that causes the counter to count down.
Set the source object that causes the counter to count down .