Exemple #1
0
// ------------------------------------------------------------------------------------------------------------------
// call this to initialise the device
void initDevice( void )
{

  	// Stop watchdog timer to prevent time out reset
	WDTCTL = WDTPW + WDTHOLD;

	// setup clock
	cfgSystemClock();

	// configure timers
	cfgTimerA();
	
	// configure ports
	cfgPort1();
	cfgPort2();
	cfgPort3();

	// configure UART serial interface
	cfgUART();

	// initialise some variables
	UART.commandState = CMD_STATE_NOP;
	UART.commandStateGroup = CMD_STATE_NOP;
	drawUtils.blendMode = BLEND_MODE_REPLACE;

	// enable global interrupts
	__bis_SR_register(GIE);
}
Exemple #2
0
int main(void)
{ 
  uint16_t i;

  //cfg_PWM();
  cfgUART();
  cfg_Timer();
  cfg_GPIO();
  //calc_servo();

  while(1)
  {
    if(!RefreshUART)
    {
      RefreshUART = 1;
      UARTprintf("\nDigite os valores de saida dos motores:");
    }
  }
}