Beispiel #1
0
int main(void)
//   Input    : -
//   Output   : -
//   Function : main function. Runs the init function and then loops


{
    //Initialization
    disable_global_int();
    SysTick_init();
    GPIO_init();
    swtimers_init();
    RTCS_init();

    UART0_init(19200, 8, 1, 0);
    enable_global_int();
    LCD_init();
    queue_init(&display_lcd_queue);
    queue_init(&uart0_rx_queue);
    numpad_init();

    open_queue(Q_LCD);
    open_queue(Q_INPUT);

    start_task( TASK_RTC, RTC_task);
    start_task( TASK_DISPLAY, display_task);
    start_task( TASK_LCD, LCD_task);
    start_task( TASK_NUMPAD, numpad_task);
    start_task( TASK_UI, ui_task);
    start_task( TASK_UART0, UART0_task);

    schedule();

    return (0);
}
Beispiel #2
0
int main(void)
{
	disable_global_int();
	init_clk_system();
	init_gpio();
	init_status_led();
	init_spi();
	systick_init();
	enable_global_int();
	INT8U counter = 0;

	while(1)
	{
		/* System part of the super loop. */
		while(!ticks);
		// The following will be executed every 5mS
		ticks--;
		
		if (!--alive_timer)
		{
			alive_timer = TIM_500_MSEC;
			GPIO_PORTF_DATA_R ^= 0x01;
			SSI0_DR_R = counter++;		// Send this through SPI
		}
		/* Application part of the super loop. */
		//counter = SSI0_SR_R;
	}
	return (0);
}
static void setupHardware(void) {
    // TODO: Put hardware configuration and initialisation in here
    disable_global_int();
    clk_system_init();
    init_leds();
    //init_pot();
    init_buttons();
    init_spi();
    init_lcd_write_task();
    init_uart0();
    init_joystick();
     
    enable_global_int();
     
 
    // Warning: If you do not initialize the hardware clock, the timings will be inaccurate
}
int main(void)
/*****************************************************************************
*   Input    :
*   Output   :
*   Function : The super loop.
******************************************************************************/
{
  INT8U event;
  INT8U counter_value;

  disable_global_int();
  init_systick();
  init_gpio();
  enable_global_int();


  // Loop forever.
  while(1)
  {
	// System part of the super loop.
	// ------------------------------
	while( !ticks );


	// The following will be executed every 5mS
	ticks--;

	if( ! --alive_timer )
	{
    	alive_timer =	MILLISEC( 500 );
	  	GPIO_PORTD_DATA_R ^= 0x40;
	}

    // Protected operating system mode
    swt_ctrl();

    // Application mode
    task_rtc( TASK_RTC );
    task_button( TASK_BUTTON );
    task_set_time( TASK_SET_TIME );
    task_lcd( TASK_LCD );
  }
}