mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2025-04-21 12:27:27 +03:00
atusb/fw: use the unique serial number of the ATmega8/16/32U2 for iSerialNumber
- 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
This commit is contained in:
36
atusb/fw/sernum.h
Normal file
36
atusb/fw/sernum.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* fw/sernum.h - ATUSB serial number
|
||||
*
|
||||
* Written 2011 by Werner Almesberger
|
||||
* Copyright 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.
|
||||
*/
|
||||
|
||||
#ifndef SERNUM_H
|
||||
#define SERNUM_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "board.h"
|
||||
|
||||
|
||||
#ifdef HAS_BOARD_SERNUM
|
||||
|
||||
int sernum_get_descr(uint8_t type, uint8_t index, const uint8_t **reply,
|
||||
uint8_t *size);
|
||||
|
||||
#else /* HAS_BOARD_SERNUM */
|
||||
|
||||
static inline int sernum_get_descr(uint8_t type, uint8_t index,
|
||||
const uint8_t **reply, uint8_t *size)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* !HAS_BOARD_SERNUM */
|
||||
|
||||
#endif /* !SERNUM_H */
|
||||
Reference in New Issue
Block a user