Random number generator

Dependents:   mBuinoBlinky

Files at this revision

API Documentation at this revision

Comitter:
feb11
Date:
Tue Sep 17 18:18:15 2013 +0000
Parent:
1:0536a4ca8d35
Commit message:
change public API to static

Changed in this revision

Random.cpp Show annotated file Show diff for this revision Revisions of this file
Random.h Show annotated file Show diff for this revision Revisions of this file
diff -r 0536a4ca8d35 -r 2eb90943983b Random.cpp
--- a/Random.cpp	Tue Sep 17 12:35:12 2013 +0000
+++ b/Random.cpp	Tue Sep 17 18:18:15 2013 +0000
@@ -1,9 +1,10 @@
 #include "Random.h"
 #include "Crypto.h"
 
-Random::Random():
-e(p19),
-f(p20)
+static uint8_t pool[16];
+static AnalogIn e(p19),f(p20);
+
+void Random::init()
 {
     AnalogIn a(p15), b(p16), c(p17), d(p18);
     
diff -r 0536a4ca8d35 -r 2eb90943983b Random.h
--- a/Random.h	Tue Sep 17 12:35:12 2013 +0000
+++ b/Random.h	Tue Sep 17 18:18:15 2013 +0000
@@ -7,15 +7,9 @@
 {
     public :
         
-        Random();
-        
-        uint8_t getByte();
-        void getBytes(uint8_t *out, uint32_t length);
-
-    private :
-    
-        uint8_t pool[16];
-        AnalogIn e,f;
+        static void init();
+        static uint8_t getByte();
+        static void getBytes(uint8_t *out, uint32_t length);
 };
 
 #endif