void CANInitialize()
{
	EPOSInit(&_canInit);
	printf("EPOS INIT\n\r");
	Delay(500);

	uint8_t i;
	for(i = 0; i < NUM_MOTORS; ++i)
	{
		printf("EPOS Enable Start:%i\n\r",i);
		EPOSEnable(_motor[i].NodeID);
		printf("EPOS ENABLE:%i\n\r",i);
		Delay(100);
	}

	//Do it twice, not optimal but works better (*25.11.13: happened not to work at all when removed!!!)
	for(i = 0; i < NUM_MOTORS; ++i)
	{
		EPOSEnable(_motor[i].NodeID);
		Delay(100);
	}

	for(i = 0; i < NUM_MOTORS; ++i)
	{
		CurrentMode(_motor[i].NodeID);
		printf("Set Current Mode:%i\n\r",i);
		Delay(200);
	}
}
Exemple #2
0
//o---------------------------------------------------------------------------o
//|   Function    -  Warning
//|   Date        -  21st January, 2002
//|   Programmer  -  Abaddon
//o---------------------------------------------------------------------------o
//|   Purpose     -  Writes to the warning log and the console.
//o---------------------------------------------------------------------------o
void CConsole::Warning( const char *toWrite, ... )
{
	UI08 oldMode = CurrentMode();
	CurrentMode( WARNINGMODE );
	va_list argptr;
	char msg[MAX_CONSOLE_BUFF];
	va_start( argptr, toWrite );
	vsnprintf( msg, MAX_CONSOLE_BUFF, toWrite, argptr );
	va_end( argptr );
	Log( msg, "warning.log" );
	if( curLeft != 0 )
		(*this) << myendl;
	TurnBlue();
	(*this) << "WARNING: " << (const char*)&msg[0] << myendl;
	TurnNormal();
	CurrentMode( oldMode );
}
Exemple #3
0
//o---------------------------------------------------------------------------o
//|   Function    -  Error
//|   Date        -  Unknown
//|   Programmer  -  Unknown
//o---------------------------------------------------------------------------o
//|   Purpose     -  Writes to the error log and the console.
//o---------------------------------------------------------------------------o
void CConsole::Error( const char *toWrite, ... )
{
	UI08 oldMode = CurrentMode();
	CurrentMode( ERRORMODE );
	va_list argptr;
	char msg[MAX_CONSOLE_BUFF];
	va_start( argptr, toWrite );
	vsnprintf( msg, MAX_CONSOLE_BUFF, toWrite, argptr );
	va_end( argptr );
	Log( msg, "error.log" );
	if( curLeft != 0 )
		(*this) << myendl;
	TurnRed();
	(*this) << "ERROR: " << (const char*)&msg[0] << myendl;
	TurnNormal();
	CurrentMode( oldMode );
}
bool ViewPort::Divisor::Divide(Divisor *Divisor, const double &Size)
{
  // Add a new window to the split.
  if(CurrentMode() == 2)
    return false;
  SubDivisors.push_back(Divisor);
  Sizes.push_back(Size);
  return true;
}
bool ViewPort::Divisor::SetHorizontal(bool Horizontal)
{
  // Change split mode to horozontal split
  if(CurrentMode() == 2)
    return false;
  
  this->Horizontal = Horizontal;
  return true;
}