code/WPILib/Counter.cpp
/**
 * Set the source object that causes the counter to count up.
 * Set the up counting DigitalSource.
 */
Set the source object that causes the counter to count up.
Set the up counting DigitalSource.
Set the source object that causes the counter to count up . Set the up counting DigitalSource .
void Counter::SetUpSource(DigitalSource *source)
{
	if (m_allocatedUpSource)
	{
		delete m_upSource;
		m_upSource = NULL;
		m_allocatedUpSource = false;
	}
	m_upSource = source;
	m_counter->writeConfig_UpSource_Module(source->GetModuleForRouting(), &status);
	m_counter->writeConfig_UpSource_Channel(source->GetChannelForRouting(), &status);
	m_counter->writeConfig_UpSource_AnalogTrigger(source->GetAnalogTriggerForRouting(), &status);
	if(m_counter->readConfig_Mode(&status) == kTwoPulse ||
			m_counter->readConfig_Mode(&status) == kExternalDirection)
	{
		SetUpSourceEdge(true, false);
	}
	m_counter->strobeReset(&status);
	wpi_assertCleanStatus(status);
}
void Counter :: SetUpSource ( DigitalSource * source ) { if ( m_allocatedUpSource ) { delete m_upSource ; m_upSource = NULL ; m_allocatedUpSource = false ; } m_upSource = source ; m_counter -> writeConfig_UpSource_Module ( source -> GetModuleForRouting ( ) , & status ) ; m_counter -> writeConfig_UpSource_Channel ( source -> GetChannelForRouting ( ) , & status ) ; m_counter -> writeConfig_UpSource_AnalogTrigger ( source -> GetAnalogTriggerForRouting ( ) , & status ) ; if ( m_counter -> readConfig_Mode ( & status ) == kTwoPulse || m_counter -> readConfig_Mode ( & status ) == kExternalDirection ) { SetUpSourceEdge ( true , false ) ; } m_counter -> strobeReset ( & status ) ; wpi_assertCleanStatus ( status ) ; }
Set the source object that causes the counter to count up.
Set the source object that causes the counter to count up .