Exemplo n.º 1
0
int main(void)
{
	 SystemInit();
	 Leds_Init();


	 USBD_Init(&USB_OTG_dev,
			  	USB_OTG_FS_CORE_ID,
	            &USR_desc,
	            &USBD_MSC_cb,
	            &USR_cb);

    while(1)
    {

    }
}
Exemplo n.º 2
0
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void HidApp_Init(void)
{
	/* LUFA: Disable watchdog if enabled by bootloader fuses */
	MCUSR &= ~(1 << WDRF);
	wdt_disable();

	/* LUFA: Disable clock division */
	clock_prescale_set(clock_div_1);

	/* Hardware Initialization */
	USB_Init();
	BoardConfig_Init();
	Encoder_Init(	EVENT_EncoderButtonDown, 
					EVENT_EncoderButtonUp, 
					EVENT_Encoder_CC, 
					EVENT_Encoder_CCW);
	Leds_Init();
}
Exemplo n.º 3
0
int main() {
    CHIP_Init();

    if (SysTick_Config(CMU_ClockFreqGet(cmuClock_CORE) / 1000)) while (1) ;

    Leds_Init();

    bool clear = false;
    int i = 0;
    while (1) {
        if (!clear)
            Leds_SetLed(i++);
        else
            Leds_ClearLed(i++);

        if (i == NUM_LEDS) {
            i = 0;
            clear = !clear;
        }
        Delay(500);
    }
}