From 1b44985a0fde2cea64d963f96c5d6d33798cd961 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 18 Dec 2017 15:34:38 -0500 Subject: [PATCH] Add CKSSThree switch, ENUMS macro --- include/components.hpp | 8 + include/util.hpp | 10 + res/ComponentLibrary/CKSSThree_0.svg | 321 ++++++++++++++++++++++++++ res/ComponentLibrary/CKSSThree_1.svg | 322 +++++++++++++++++++++++++++ res/ComponentLibrary/CKSSThree_2.svg | 322 +++++++++++++++++++++++++++ 5 files changed, 983 insertions(+) create mode 100644 res/ComponentLibrary/CKSSThree_0.svg create mode 100644 res/ComponentLibrary/CKSSThree_1.svg create mode 100644 res/ComponentLibrary/CKSSThree_2.svg diff --git a/include/components.hpp b/include/components.hpp index c300e44b..6e4807c3 100644 --- a/include/components.hpp +++ b/include/components.hpp @@ -461,6 +461,14 @@ struct CKSS : SVGSwitch, ToggleSwitch { } }; +struct CKSSThree : SVGSwitch, ToggleSwitch { + CKSSThree() { + addFrame(SVG::load(assetGlobal("res/ComponentLibrary/CKSSThree_0.svg"))); + addFrame(SVG::load(assetGlobal("res/ComponentLibrary/CKSSThree_1.svg"))); + addFrame(SVG::load(assetGlobal("res/ComponentLibrary/CKSSThree_2.svg"))); + } +}; + struct CKD6 : SVGSwitch, MomentarySwitch { CKD6() { addFrame(SVG::load(assetGlobal("res/ComponentLibrary/CKD6_0.svg"))); diff --git a/include/util.hpp b/include/util.hpp index f7e4732a..3e7b53dc 100644 --- a/include/util.hpp +++ b/include/util.hpp @@ -30,6 +30,16 @@ will expand to #define LENGTHOF(arr) (sizeof(arr) / sizeof((arr)[0])) +/** Reserve space for _count enums starting with _name. +Example: + enum Foo { + ENUMS(BAR, 14) + }; + + BAR + 0 to BAR + 11 is reserved +*/ +#define ENUMS(_name, _count) _name, _name ## _LAST = _name + (_count) - 1 + /** Deprecation notice for GCC */ #define DEPRECATED __attribute__ ((deprecated)) diff --git a/res/ComponentLibrary/CKSSThree_0.svg b/res/ComponentLibrary/CKSSThree_0.svg new file mode 100644 index 00000000..a8283517 --- /dev/null +++ b/res/ComponentLibrary/CKSSThree_0.svg @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/res/ComponentLibrary/CKSSThree_1.svg b/res/ComponentLibrary/CKSSThree_1.svg new file mode 100644 index 00000000..46656fcf --- /dev/null +++ b/res/ComponentLibrary/CKSSThree_1.svg @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/res/ComponentLibrary/CKSSThree_2.svg b/res/ComponentLibrary/CKSSThree_2.svg new file mode 100644 index 00000000..cbfd986b --- /dev/null +++ b/res/ComponentLibrary/CKSSThree_2.svg @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + +