Exemple #1
0
static void bootsource_action(struct menu *m, struct menu_entry *me)
{
	struct blspec_entry *be = container_of(me, struct blspec_entry, me);
	int ret;

	ret = boot_entry(be);
	if (ret)
		printf("Booting failed with: %s\n", strerror(-ret));

	printf("Press any key to continue\n");

	read_key();
}
Exemple #2
0
void enterBootloader()
{
	// TABLE FLIP
	cli();
	UDCON = _BV(DETACH); // Detach USB
	USBCON = _BV(FRZCLK);  // disable USB
	PORTB = 0;
	PORTC = 0;
	PORTD = 0;
	DDRB = 0;
	DDRC = 0;
	DDRD = 0;
	// clear timers
	TCCR0B = 0;
	TCCR0A = 0;
	TIMSK0 = 0;
	TIFR0 = 7;
	
	_delay_ms(2000);
	
	boot_entry();
}