summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2017-04-05 10:14:24 +0300
committerFred Sundvik <fsundvik@gmail.com>2017-04-09 18:34:59 +0300
commitb7041d06aef4dcf2f2a47504a699e538cfb1d9ac (patch)
tree7478e6a52667d312ebfb7e46d56378fa948a51b9
parent64d63ab42281318d891434fbc00277043298dd70 (diff)
downloadqmk_firmware-b7041d06aef4dcf2f2a47504a699e538cfb1d9ac.tar.gz
qmk_firmware-b7041d06aef4dcf2f2a47504a699e538cfb1d9ac.zip
Move common visualizer keyframes into visualizer_keyframes.h
-rw-r--r--keyboards/ergodox/infinity/visualizer.c1
-rw-r--r--keyboards/ergodox/keymaps/default/visualizer.c1
-rw-r--r--quantum/visualizer/visualizer.c6
-rw-r--r--quantum/visualizer/visualizer.h6
-rw-r--r--quantum/visualizer/visualizer.mk3
-rw-r--r--quantum/visualizer/visualizer_keyframes.c23
-rw-r--r--quantum/visualizer/visualizer_keyframes.h26
7 files changed, 54 insertions, 12 deletions
diff --git a/keyboards/ergodox/infinity/visualizer.c b/keyboards/ergodox/infinity/visualizer.c
index 0897ea348b..2e10fdd709 100644
--- a/keyboards/ergodox/infinity/visualizer.c
+++ b/keyboards/ergodox/infinity/visualizer.c
@@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
#include "visualizer.h"
+#include "visualizer_keyframes.h"
#include "lcd_keyframes.h"
#include "lcd_backlight_keyframes.h"
#include "system/serial_link.h"
diff --git a/keyboards/ergodox/keymaps/default/visualizer.c b/keyboards/ergodox/keymaps/default/visualizer.c
index 73d864c646..f6159e1ef1 100644
--- a/keyboards/ergodox/keymaps/default/visualizer.c
+++ b/keyboards/ergodox/keymaps/default/visualizer.c
@@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
#include "visualizer.h"
+#include "visualizer_keyframes.h"
#include "lcd_keyframes.h"
#include "lcd_backlight_keyframes.h"
#include "system/serial_link.h"
diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c
index 5fbd12031e..2479a64c7f 100644
--- a/quantum/visualizer/visualizer.c
+++ b/quantum/visualizer/visualizer.c
@@ -230,12 +230,6 @@ void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* stat
(*temp_animation.frame_functions[next_frame])(&temp_animation, &temp_state);
}
-bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state) {
- (void)animation;
- (void)state;
- return false;
-}
-
// TODO: Optimize the stack size, this is probably way too big
static DECLARE_THREAD_STACK(visualizerThreadStack, 1024);
static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h
index 4639348492..d6f279e101 100644
--- a/quantum/visualizer/visualizer.h
+++ b/quantum/visualizer/visualizer.h
@@ -34,7 +34,7 @@ SOFTWARE.
#include "lcd_backlight.h"
#endif
-// use this function to merget both real_mods and oneshot_mods in a uint16_t
+// use this function to merge both real_mods and oneshot_mods in a uint16_t
uint8_t visualizer_get_mods(void);
// This need to be called once at the start
@@ -126,10 +126,6 @@ void stop_keyframe_animation(keyframe_animation_t* animation);
// Useful for crossfades for example
void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state);
-// Some predefined keyframe functions that can be used by the user code
-// Does nothing, useful for adding delays
-bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state);
-
// The master can set userdata which will be transferred to the slave
#ifdef VISUALIZER_USER_DATA_SIZE
void visualizer_set_user_data(void* user_data);
diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk
index c9eb8c5bbd..799379e3d6 100644
--- a/quantum/visualizer/visualizer.mk
+++ b/quantum/visualizer/visualizer.mk
@@ -20,7 +20,8 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-SRC += $(VISUALIZER_DIR)/visualizer.c
+SRC += $(VISUALIZER_DIR)/visualizer.c \
+ $(VISUALIZER_DIR)/visualizer_keyframes.c
EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR)
GFXLIB = $(LIB_PATH)/ugfx
VPATH += $(VISUALIZER_PATH)
diff --git a/quantum/visualizer/visualizer_keyframes.c b/quantum/visualizer/visualizer_keyframes.c
new file mode 100644
index 0000000000..8f6a7e15a4
--- /dev/null
+++ b/quantum/visualizer/visualizer_keyframes.c
@@ -0,0 +1,23 @@
+/* Copyright 2017 Fred Sundvik
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "visualizer_keyframes.h"
+
+bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state) {
+ (void)animation;
+ (void)state;
+ return false;
+}
diff --git a/quantum/visualizer/visualizer_keyframes.h b/quantum/visualizer/visualizer_keyframes.h
new file mode 100644
index 0000000000..9ef7653c5e
--- /dev/null
+++ b/quantum/visualizer/visualizer_keyframes.h
@@ -0,0 +1,26 @@
+/* Copyright 2017 Fred Sundvik
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_
+#define QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_
+
+#include "visualizer.h"
+
+// Some predefined keyframe functions that can be used by the user code
+// Does nothing, useful for adding delays
+bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state);
+
+#endif /* QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_ */