code/WPILib/CANJaguar.cpp
/**
 * Common initialization code called by all constructors.
 */
Common initialization code called by all constructors.
Common initialization code called by all constructors .
void CANJaguar::InitCANJaguar()
{
	m_transactionSemaphore = semMCreate(SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE);
	if (m_deviceNumber < 1 || m_deviceNumber > 63)
	{
		printf("ERROR: Invalid CAN device number \"%d\" - must be between 1 and 63.\n", m_deviceNumber);
		return;
	}
	UINT32 fwVer = GetFirmwareVersion();
	if (fwVer >= 3330 || fwVer < 92)
	{
		printf("fwVersion[%d]: %d\n", m_deviceNumber, fwVer);
		if (fwVer < 3330)
		{
			printf("ERROR: Jaguar %d firmware is too old.  It must be updated to at least version 92 of the FIRST approved firmware!\n", m_deviceNumber);
		}
		else
		{
			printf("ERROR: Jaguar %d firmware is not FIRST approved.  It must be updated to at least version 92 of the FIRST approved firmware!\n", m_deviceNumber);
		}
		wpi_assertCleanStatus(kRIOStatusVersionMismatch);
		return;
	}
	switch (m_controlMode)
	{
	case kPercentVbus:
	case kVoltage:
		EnableControl();
		break;
	default:
		break;
	}
	m_safetyHelper = new MotorSafetyHelper(this);
}
void CANJaguar :: InitCANJaguar ( ) { m_transactionSemaphore = semMCreate ( SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE ) ; if ( m_deviceNumber < 1 || m_deviceNumber > 63 ) { printf ( " \" \" \n " , m_deviceNumber ) ; return ; } UINT32 fwVer = GetFirmwareVersion ( ) ; if ( fwVer >= 3330 || fwVer < 92 ) { printf ( " \n " , m_deviceNumber , fwVer ) ; if ( fwVer < 3330 ) { printf ( " \n " , m_deviceNumber ) ; } else { printf ( " \n " , m_deviceNumber ) ; } wpi_assertCleanStatus ( kRIOStatusVersionMismatch ) ; return ; } switch ( m_controlMode ) { case kPercentVbus : case kVoltage : EnableControl ( ) ; break ; default : break ; } m_safetyHelper = new MotorSafetyHelper ( this ) ; }
Common initialization code called by all constructors.
Common initialization code called by all constructors .
// Error // 3330 was the first shipping RDK firmware version for the Jaguar // No additional configuration required... start enabled.