Root/atusb/fw/atusb.c

Source at commit 78cfc8ffeb03a6fd6a1e63295c9d807eda84017d created 8 years 4 months ago.
By Werner Almesberger, moved atusb/fw3/ to atusb/fw/
1/*
2 * fw/atusb.c - ATUSB initialization and main loop
3 *
4 * Written 2008-2011 by Werner Almesberger
5 * Copyright 2008-2011 Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13
14#include <stdint.h>
15
16#include <avr/io.h>
17
18#define F_CPU 8000000UL
19#include <util/delay.h>
20
21#include "usb.h"
22
23#include "board.h"
24#include "spi.h"
25#include "atusb/ep0.h"
26
27
28int main(void)
29{
30    board_init();
31    spi_init();
32    reset_rf();
33
34    /* now we should be at 8 MHz */
35
36#if 0
37    led(1);
38    _delay_ms(100);
39    led(0);
40#endif
41
42    usb_init();
43    ep0_init();
44
45    while (1)
46        usb_poll();
47}
48

Archive Download this file



interactive