diff options
author | jaseg <git@jaseg.net> | 2020-03-23 01:07:19 +0100 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2020-03-23 01:07:19 +0100 |
commit | 6ea56ed6ceacd990e0255d592032af4bd84f7cd6 (patch) | |
tree | fa432bc57eb2fcf5607a0e3bbf0b839d0d1637fe /fw/mac.h | |
download | lampomatic-6ea56ed6ceacd990e0255d592032af4bd84f7cd6.tar.gz lampomatic-6ea56ed6ceacd990e0255d592032af4bd84f7cd6.tar.bz2 lampomatic-6ea56ed6ceacd990e0255d592032af4bd84f7cd6.zip |
foo
Diffstat (limited to 'fw/mac.h')
-rw-r--r-- | fw/mac.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fw/mac.h b/fw/mac.h new file mode 100644 index 0000000..26aaff6 --- /dev/null +++ b/fw/mac.h @@ -0,0 +1,22 @@ +#ifndef __MAC_H__ +#define __MAC_H__ + +#include <unistd.h> + +/* Device MAC address. + * + * 32 bits might seem a little short for a device MAC, but at 20 bus nodes the probablility of a collision is about 1 in + * 10 million. Check for yourself using the python code below. + * + * #!/usr/bin/env python3 + * from operator import mul + * from functools import reduce + * m = 32 + * n = 20 + * print(reduce(mul, [2**m-i for i in range(n)]) / ((2**m)**n)) + * # -> 0.9999999557621786 + */ + +extern uint32_t device_mac; + +#endif /* __MAC_H__ */ |