2011-02-09 00:32:15 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include <avr/io.h>
|
|
|
|
|
|
|
|
#define F_CPU 8000000UL
|
|
|
|
#include <util/delay.h>
|
|
|
|
|
|
|
|
#include "freakusb.h"
|
|
|
|
|
2011-02-10 12:19:55 +02:00
|
|
|
#include "board.h"
|
2011-02-09 02:32:24 +02:00
|
|
|
#include "spi.h"
|
2011-02-10 12:24:37 +02:00
|
|
|
#include "atusb/ep0.h"
|
2011-02-09 00:32:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2011-02-11 01:49:23 +02:00
|
|
|
board_init();
|
2011-02-09 02:32:24 +02:00
|
|
|
spi_init();
|
|
|
|
reset_rf();
|
2011-02-09 00:32:15 +02:00
|
|
|
|
|
|
|
/* now we should be at 8 MHz */
|
|
|
|
|
2011-02-11 01:49:23 +02:00
|
|
|
led(1);
|
2011-02-09 00:32:15 +02:00
|
|
|
_delay_ms(100);
|
2011-02-11 01:49:23 +02:00
|
|
|
led(0);
|
2011-02-09 00:32:15 +02:00
|
|
|
|
|
|
|
usb_init();
|
2011-02-09 04:53:25 +02:00
|
|
|
ep0_init();
|
2011-02-09 00:32:15 +02:00
|
|
|
hw_init();
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
usb_poll();
|
|
|
|
}
|