summaryrefslogtreecommitdiff
path: root/src/system.h
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-05-31 10:56:17 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-05-31 10:56:17 +0200
commitd040ed5eecb104c201b330c468df3b6d8c59b7f1 (patch)
tree7ea3bf6e09734f742af1814487dd8a53a62388af /src/system.h
Initial commit. Working static light, but no rgbfade yet
Diffstat (limited to 'src/system.h')
-rw-r--r--src/system.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/system.h b/src/system.h
new file mode 100644
index 0000000..35c7172
--- /dev/null
+++ b/src/system.h
@@ -0,0 +1,52 @@
+#ifndef __SYSTEM_H__
+#define __SYSTEM_H__
+
+class System {
+ private:
+ uint8_t btn_debounce;
+
+ void idle(void);
+ void sleep(void);
+
+ uint8_t warmwhite;
+ uint8_t red;
+ uint8_t green;
+ uint8_t blue;
+
+ void set_outputs();
+
+ public:
+
+ void initialize(void);
+
+ void loop(void);
+
+ uint8_t is_charging;
+
+ enum BCMode : uint8_t {
+ OFF = 0,
+ WARMWHITE,
+ RED,
+ GREEN,
+ BLUE,
+ YELLOW,
+ MAGENTA,
+ CYAN,
+ SUN,
+ MODE_ENUM_MAX,
+ };
+
+ BCMode mode;
+
+ void next_mode(void);
+
+ void debounce_done(void);
+
+ void debounce_start(void);
+
+ System() { btn_debounce = 0; mode = OFF; is_charging = 0; };
+};
+
+extern System blinkencat;
+
+#endif