Exemplo n.º 1
0
/**
	LEDP:
		This example switches on the uXbot LEDs sequentially each time the user presses
		the BTN1 pushbutton.
	*/
int main()
{
	uint8_t led_index = LED_D4;			///< Variable that holds the LED number to be switched on
	
	uXbot_Init();						///< uXbot hardware initialization

	while(1)							///< Infinite loop
	{
		pushbutton1_wait();				///< Wait until the user presses the BTN1 pushbutton
		
		turn_leds_off();					
		led_set(led_index,LED_ON);		///< Switch on this single LED
		
		switch(led_index)				///< Calculate what LED to switch on next
		{
			case LED_D4:				///< If last LED was D4, the next one will be D3
				led_index = LED_D3;
				break;
			case LED_D3:				///< If last LED was D3, the next one will be D2
				led_index = LED_D2;
				break;
			case LED_D2:
				led_index = LED_D1;		///< If last LED was D2, the next one will be D1
				break;
			case LED_D1:
				led_index = LED_D4;		///< If last LED was D1, the next one will be D4 to start over
				break;				
		}
		
	}
}
Exemplo n.º 2
0
/* miscellaneous platform dependent initialisations */
int misc_init_r(void)
{
#ifdef CONFIG_BFIN_MAC
	uchar enetaddr[6];
	if (!eth_getenv_enetaddr("ethaddr", enetaddr))
		board_init_enetaddr(enetaddr);
#endif

	gpio_cfi_flash_init();
	init_tlv320aic31();
	init_mute_pin();
	turn_leds_off();

	return 0;
}