mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-23 05:56:15 +02:00
85f60de9d5
- usb/usb.h (USB_LANGID_ENGLISH_US): added USB LANGID for US-English - board.h (board_sernum), board.c (board_sernum, hex, get_sernum, board_init): provide the board's serial number in "board_sernum" (UTF-encoded) - sernum.h (sernum_get_descr), sernum.c (sernum_get_descr): return string descriptors for the serial number - descr.c (device_descriptor), usb/dfu.c (device_descriptor): set iSerialNumber if serial number is available - atusb.c (main), usb/dfu.c (my_descr): call sernum_get_descr for unknown descriptors - Makefile (OBJS, BOOT_OBJS): added sernum.o
42 lines
733 B
C
42 lines
733 B
C
/*
|
|
* fw/atusb.c - ATUSB initialization and main loop
|
|
*
|
|
* Written 2008-2011 by Werner Almesberger
|
|
* Copyright 2008-2011 Werner Almesberger
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <avr/io.h>
|
|
|
|
#include "usb.h"
|
|
|
|
#include "board.h"
|
|
#include "sernum.h"
|
|
#include "spi.h"
|
|
#include "atusb/ep0.h"
|
|
|
|
|
|
int main(void)
|
|
{
|
|
board_init();
|
|
spi_init();
|
|
reset_rf();
|
|
|
|
user_get_descriptor = sernum_get_descr;
|
|
|
|
/* now we should be at 8 MHz */
|
|
|
|
usb_init();
|
|
ep0_init();
|
|
|
|
while (1)
|
|
usb_poll();
|
|
}
|