uniqueCPUID
Fork of uniqueCPUID by
uniqueCPUID.cpp@0:b9461291f915, 2016-03-09 (annotated)
- Committer:
- joeata2wh
- Date:
- Wed Mar 09 18:04:45 2016 +0000
- Revision:
- 0:b9461291f915
- Child:
- 2:08766dc8051a
Break the uniqueCPUID into separate library to make re-use easier.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joeata2wh | 0:b9461291f915 | 1 | #include "mbed.h" |
joeata2wh | 0:b9461291f915 | 2 | #include "uniqueCPUID.h" |
joeata2wh | 0:b9461291f915 | 3 | |
joeata2wh | 0:b9461291f915 | 4 | |
joeata2wh | 0:b9461291f915 | 5 | |
joeata2wh | 0:b9461291f915 | 6 | void getUniqueIDAsStr(char *destStr) |
joeata2wh | 0:b9461291f915 | 7 | { |
joeata2wh | 0:b9461291f915 | 8 | unsigned long *Unique = uniqueSerialAddr; |
joeata2wh | 0:b9461291f915 | 9 | sprintf(destStr, "S%luX%luX%luX\000", Unique[0], Unique[1], Unique[2]); |
joeata2wh | 0:b9461291f915 | 10 | } |
joeata2wh | 0:b9461291f915 | 11 | |
joeata2wh | 0:b9461291f915 | 12 | |
joeata2wh | 0:b9461291f915 | 13 | void printUniqueId(Serial pc) { |
joeata2wh | 0:b9461291f915 | 14 | unsigned long *Unique = uniqueSerialAddr; |
joeata2wh | 0:b9461291f915 | 15 | printf("Simple Serial# %08luX %08luX %08luX\n", Unique[0], Unique[1], Unique[2]); |
joeata2wh | 0:b9461291f915 | 16 | } |