Exemple #1
0
void SystemSetup(void) {
	IORegSetup();			// Setup.c
	#if defined(USE_TIMER)
		TimerRegSetup();	// Setup.c
		TimerSetup();		// Setup.c
	#endif
	#if (defined(USE_UART) || defined(USE_MU))
		UartRegSetup();		// Setup.c
		UartSetup();		// Uart.c
	#endif
	#if defined(USE_EXINT)
		ExintRegSetup();	// Setup.c
	#endif
	#if defined(USE_PCINT)
		PcintRegSetup();	// Setup.c
	#endif
	
	#if defined(USE_EXINT)
		ExintSetup();
	#endif
	#if defined(USE_PCINT)
		PcintSetup();
	#endif
	#if defined(USE_ENCODER)
		EncoderSetup();		// Encoder.c
	#endif
	#if defined(USE_MU)
		MuSetup();			// Mu.c
	#endif
	
	#if defined(USE_MOTOR)
		MotorSetup();		// Motor.c
	#endif
	#if defined(USE_SERVO)
		ServoSetup();		// Servo.c
	#endif
	
	#if defined(USE_SAFETY)
		SafetySetup();		// Safety.c
	#endif
}
task main()
{
	ServoSetup();

  //waitForStart();

	StartTask(stage);
	StartTask(tube);
	StartTask(motion);
	StartTask(elevator);

	while(true)
	{
		motor[FR] = 0;
    motor[BR] = 0;
    motor[FL] = 0;
    motor[BL] = 0;
    motor[UR] = 0;
    motor[UL] = 0;
  }
}