Created
November 18, 2017 23:53
-
-
Save MightyPork/633afc3173dd1b3eb5c9031f9265e14e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <inttypes.h> | |
#include <stdlib.h> | |
#include "stm32f1xx_ll_utils.h" | |
/** | |
* @brief USBD_FS_SerialStrDescriptor | |
* return the serial number string descriptor | |
* @param speed : current device speed | |
* @param length : pointer to data length variable | |
* @retval pointer to descriptor buffer | |
*/ | |
uint8_t * USBD_FS_SerialStrDescriptor( USBD_SpeedTypeDef speed , uint16_t *length) | |
{ | |
char buff[25]; | |
sprintf(buff, "%08"PRIX32"%08"PRIX32"%08"PRIX32, | |
LL_GetUID_Word0(), | |
LL_GetUID_Word1(), | |
LL_GetUID_Word2() | |
); | |
USBD_GetString ((uint8_t *) &buff[0], USBD_StrDesc, length); | |
return USBD_StrDesc; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment