Ejemplo n.º 1
0
/*****************************************************************************************************                                                                        
*   Function: main()
*
*   Description: what I can say about it, it just the tipical main
*
*   Caveats:
*****************************************************************************************************/
void main(void) 
{
  /*Disable interrupts to start the MCU configuration*/  
  DisableInterrupts;
  /* Intilialize the interupt vector base address for default location */
  Init_Interrupt_Vector();
    
  Mcu_Init();
  DDRA =0x0F;
  DDRB =0x0F;
  
  EnableInterrupts;
  
  SchM_Init(SchM_TaskConfigInitial);
  SchM_Start();
  
  for(;;) 
  {
    /* Call the scheduler */
    SchM_Background();
    /* feeds the dog */
    _FEED_COP(); 
  } 
  /* loop forever */
  /* please make sure that you never leave main */
}
Ejemplo n.º 2
0
/*~~~~~~~ Main Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
void main(void) 

{
	initModesAndClock();
	initPeriClkGen();
	
	/* Disable Watchdog */
	init_disableWatchdog();
	
	/*Initialize LEDs on TRK-MPC560xB board */
	init_OnBoardLEDs();
	
	/*Initialize the On-Board push buttons*/
	init_OnBoardPushButtons();
	
	/*Initialize Interrupts */
	INTC_InitINTCInterrupts();
	/*Initialize Exception Handlers */
	EXCEP_InitExceptionHandlers();
    
    IntcInterruptLINFLEXHandlers();
    
    InitLinFlex0Slave(9600);
    
    LED_Off(LED1);
    LED_Off(LED2);
    LED_Off(LED3);
    LED_Off(LED4);
    
    /*Initialize scheduler*/	
    SchM_Init(&SchConfig);
    
    /*Hand control to the scheduler*/
    SchM_Start();
    
    for(;;)
    {
    	
    }
}
Ejemplo n.º 3
0
/*~~~~~~~ Main Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
int main(void)

{


    initModesAndClock();
    /* Disable Watchdog */
    disableWatchdog();
    /*Initialize LEDs on TRK-MPC560xB board */

    MemAllocInit(&MemAllocConfig);

    vfnGPIO_LED_Init();
    /*Initialize Interrupts */
    INTC_InitINTCInterrupts();
    /*Initialize Exception Handlers */
    EXCEP_InitExceptionHandlers();

//	PIT_device_init();
    //  PIT_channel_configure(PIT_CHANNEL_0 , Test);
    //  PIT_channel_start(PIT_CHANNEL_0);

    /* Enable External Interrupts*/
    enableIrq();

    /* Infinite loop */


    SchM_Init(&SchedulerConfig);
    SchM_Start();


    for (;;)
    {


        BackgroundSubsystemTasks();
    }
}
Ejemplo n.º 4
0
/*~+:Main Code*/
int main(void) 

{
	/*Enable peri set 1 sysclk divided by 1 */
	
	/* Mode initializations */
	sysinit_InitMode();
	/* Clock initializations */
	sysinit_InitSysClock();
	/* Memory Allcoation Initialization */
	MemAllocInit(&MemAllocConfig);
	/*Initialize LEDs on TRK-MPC560xB board */
	vfnGPIO_LED_Init(); 
	/* SBC dependencies */
	InitDSPI_1();
	ConfigureMZC33905DSPI_1();
	/* CAN Initialization */
	CAN_Initialization(&can_driver_config);
	/* Initialize Interrupts */
	INTC_InitINTCInterrupts();
	/*Initialize Exception Handlers */
	EXCEP_InitExceptionHandlers();
	/* SchM Initialization */
	SchM_Init(&SchMConfig);
    /* Enable External Interrupts*/
    enableIrq();
    /*Selection of type of Car*/
    Light_Ctrl_HwConfig();
    
    init_ADC0_P0();
    /* SchM Start */
    SchM_Start();
	/* Infinite loop - Should never reach this point */
	for (;;) 
	{

	}
}
Ejemplo n.º 5
0
/*~~~~~~~ Main Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
int main(void) 

{
	initModesAndClock();
	/* Disable Watchdog */
	disableWatchdog();
	MemAllocInit(&MemAllocConfig);
	
	Init_LIN_SLV1();	
	/*Initialize Interrupts */
	INTC_InitINTCInterrupts();
	/*Initialize Exception Handlers */
	EXCEP_InitExceptionHandlers();
    /* Enable External Interrupts*/
    enableIrq();
	/* Infinite loop */
	/*init del scheduler*/
    SchM_Init(&SchConfig);
    SchM_Start();
	for (;;) 
	{
        BackgroundSubsystemTasks();
	}
}