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
Diff: sensors/ToDoQ.h
- Revision:
- 14:b205267fa5f6
- Parent:
- 5:9d5c7ee80f3b
- Child:
- 19:b45b077c88bc
diff -r c7d1ef8c57b3 -r b205267fa5f6 sensors/ToDoQ.h --- a/sensors/ToDoQ.h Fri Apr 28 10:11:07 2017 +0000 +++ b/sensors/ToDoQ.h Tue May 16 08:58:26 2017 +0000 @@ -4,6 +4,7 @@ #include "mbed.h" #include "CommonTemplateRoutines.hpp" #include "Preferences.hpp" +#include "USQueue.hpp" #define TODO_QUEUE_SIZE 10 @@ -14,11 +15,12 @@ class ToDoQ { public: - typedef void (*onGetTodo)(ToDo*); + typedef bool (*onGetTodo)(ToDo*); static ToDoQ* create(onGetTodo); void loop(); static void queuePut(ToDo*); private: + USQueue<ToDo*> *todoQ; ToDo *q[TODO_QUEUE_SIZE]; onGetTodo _onGetTodo; DECL_GET_INSTANCE(ToDoQ); @@ -30,12 +32,25 @@ 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) { } + virtual void error_count_clear() + { + error_count = 0; + } + virtual void error_count_inc() + { + ++error_count; + } }; } #endif //_TODO_QUEUE_H_ \ No newline at end of file