UUID read and print
main.cpp
- Committer:
- sam_grove
- Date:
- 2015-04-21
- Revision:
- 7:b66c459fd169
- Parent:
- 6:3deacf18cc07
- Child:
- 8:a9f1c2722cd9
File content as of revision 7:b66c459fd169:
#include "mbed.h" // new comment //#if defined(TARGET_K64F) //#if defined(TARGET_LPC1768) #if defined(TARGET_C027) #error haha #endif int main() { unsigned int UUID_LOC_WORD0 = 0x40048060; unsigned int UUID_LOC_WORD1 = 0x4004805C; // Fetch word 0 uint32_t word0 = *(uint32_t *)UUID_LOC_WORD0; // Fetch word 1 // we only want bottom 16 bits of word1 (MAC bits 32-47) // and bit 9 forced to 1, bit 8 forced to 0 // Locally administered MAC, reduced conflicts // http://en.wikipedia.org/wiki/MAC_address uint32_t word1 = *(uint32_t *)UUID_LOC_WORD1; //word1 |= 0x00000200; //word1 &= 0x0000FEFF; //printf("%4x%08x", word1, word0); // Device id must be in lower case printf("%08x%08x", word1, word0); // Device id must be in lower case while(1); }