Root/atusb/fw/atusb.c

Source at commit 85f60de9d52195afb3a0232a03e850d96584bb9a created 8 years 6 months ago.
By Werner Almesberger, atusb/fw: use the unique serial number of the ATmega8/16/32U2 for iSerialNumber
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#include "usb.h"
19
20#include "board.h"
21#include "sernum.h"
22#include "spi.h"
23#include "atusb/ep0.h"
24
25
26int main(void)
27{
28    board_init();
29    spi_init();
30    reset_rf();
31
32    user_get_descriptor = sernum_get_descr;
33
34    /* now we should be at 8 MHz */
35
36    usb_init();
37    ep0_init();
38
39    while (1)
40        usb_poll();
41}
42

Archive Download this file



interactive