Пример #1
0
int main(void)
{
	cpu_clock_init();
	cpu_clock_pll1_max_speed();
	rtc_init();
	pin_setup();

	/* Blink LED1/2/3/4 on the board. */
	while (1)
	{
		led_on(LED1);
		led_off(LED2);
		led_on(LED3);
		led_off(LED4);
		delay(5000000);

		led_off(LED1);
		led_on(LED2);
		led_off(LED3);
		led_on(LED4);
		delay(5000000);
	}

	return 0;
}
Пример #2
0
void usb_configuration_changed(
	usb_device_t* const device
) {
	/* Reset transceiver to idle state until other commands are received */
	set_transceiver_mode(TRANSCEIVER_MODE_OFF);
	if( device->configuration->number == 1 ) {
		// transceiver configuration
		cpu_clock_pll1_max_speed();
		led_on(LED1);
	} else {
		/* Configuration number equal 0 means usb bus reset. */
		cpu_clock_pll1_low_speed();
		led_off(LED1);
	}
}