pwm period is now 200us instead of the default 20ms veml6040 config is now AF_BIT | TRIG_BIT

Dependencies:   mbed MMA8451Q USBDevice WakeUp vt100

Fork of afero_node_suntory_2017_06_15 by Orefatoi

Revision:
21:d03c7bbb9f37
Parent:
19:b45b077c88bc
--- a/sensors/ToDoQ.h	Mon Jun 05 07:59:10 2017 +0000
+++ b/sensors/ToDoQ.h	Fri Jun 09 01:49:53 2017 +0000
@@ -2,55 +2,53 @@
 #define _TODO_QUEUE_H_
 
 #include "mbed.h"
-#include "CommonTemplateRoutines.hpp"
 #include "Preferences.hpp"
 #include "USQueue.hpp"
+#include "Singletoned.hpp"
 
-namespace MaruSolSensorManager
+class ToDo;
+
+class ToDoQ :
+    public Singletoned<ToDoQ>
 {
-    class ToDo;
-    
-    class ToDoQ
-    {
-    public:
-        typedef bool (*onGetTodo)(ToDo*);
-        static ToDoQ* create(onGetTodo);
-        void loop();
-        static void queuePut(ToDo*);
-    private:
-        USQueue<ToDo*> *todoQ;
-        onGetTodo _onGetTodo;
-        DECL_GET_INSTANCE(ToDoQ);
-        DECL_SELF(ToDoQ);
-        void setOnToDo(onGetTodo);
-        void _queuePut(ToDo*);
-        ToDoQ();
-    };
+public:
+    typedef bool (*onGetTodo)(ToDo*);
+    static ToDoQ* create(onGetTodo);
+    void loop();
+    static void queuePut(ToDo*);
+private:
+    friend class Singletoned;
+    USQueue<ToDo*> *todoQ;
+    onGetTodo _onGetTodo;
+    void setOnToDo(onGetTodo);
+    void _queuePut(ToDo*);
+    ToDoQ();
+};
 
-    class ToDo
+class ToDo
+{
+protected:
+    int error_count;
+    uint8_t serialNum;
+public:
+    ToDo() : retry_count(0),error_count(0),serialNum(0) {}
+    int retry_count;
+    virtual void toJSON(char *buf) = 0;
+    virtual void getBytes(uint8_t *buf) = 0;
+    virtual void toBASE64(char *buf, PREFERENCES::_crc32 *crc32)
     {
-    protected:
-        int error_count;
-        uint8_t serialNum;
-    public:
-        ToDo() : retry_count(0),error_count(0),serialNum(0) {}
-        int retry_count;
-        virtual void toJSON(char *buf) = 0;
-        virtual void getBytes(uint8_t *buf) = 0;
-        virtual void toBASE64(char *buf, PREFERENCES::_crc32 *crc32)
-        {
-        }
-        virtual void error_count_clear()
-        {
-            error_count = 0;
-        }
-        virtual void error_count_inc()
-        {
-            ++error_count;
-        }
-        virtual void success()
-        {
-        }
-    };
-}
+    }
+    virtual void error_count_clear()
+    {
+        error_count = 0;
+    }
+    virtual void error_count_inc()
+    {
+        ++error_count;
+    }
+    virtual void success()
+    {
+    }
+};
+
 #endif //_TODO_QUEUE_H_
\ No newline at end of file