diff options
| author | Fred Sundvik <fsundvik@gmail.com> | 2017-04-05 10:14:24 +0300 |
|---|---|---|
| committer | Fred Sundvik <fsundvik@gmail.com> | 2017-04-09 18:34:59 +0300 |
| commit | b7041d06aef4dcf2f2a47504a699e538cfb1d9ac (patch) | |
| tree | 7478e6a52667d312ebfb7e46d56378fa948a51b9 /quantum/visualizer | |
| parent | 64d63ab42281318d891434fbc00277043298dd70 (diff) | |
| download | qmk_firmware-b7041d06aef4dcf2f2a47504a699e538cfb1d9ac.tar.gz qmk_firmware-b7041d06aef4dcf2f2a47504a699e538cfb1d9ac.zip | |
Move common visualizer keyframes into visualizer_keyframes.h
Diffstat (limited to 'quantum/visualizer')
| -rw-r--r-- | quantum/visualizer/visualizer.c | 6 | ||||
| -rw-r--r-- | quantum/visualizer/visualizer.h | 6 | ||||
| -rw-r--r-- | quantum/visualizer/visualizer.mk | 3 | ||||
| -rw-r--r-- | quantum/visualizer/visualizer_keyframes.c | 23 | ||||
| -rw-r--r-- | quantum/visualizer/visualizer_keyframes.h | 26 |
5 files changed, 52 insertions, 12 deletions
diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c index 5fbd12031..2479a64c7 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 | |||
| 230 | (*temp_animation.frame_functions[next_frame])(&temp_animation, &temp_state); | 230 | (*temp_animation.frame_functions[next_frame])(&temp_animation, &temp_state); |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
| 234 | (void)animation; | ||
| 235 | (void)state; | ||
| 236 | return false; | ||
| 237 | } | ||
| 238 | |||
| 239 | // TODO: Optimize the stack size, this is probably way too big | 233 | // TODO: Optimize the stack size, this is probably way too big |
| 240 | static DECLARE_THREAD_STACK(visualizerThreadStack, 1024); | 234 | static DECLARE_THREAD_STACK(visualizerThreadStack, 1024); |
| 241 | static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { | 235 | static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { |
diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 463934849..d6f279e10 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h | |||
| @@ -34,7 +34,7 @@ SOFTWARE. | |||
| 34 | #include "lcd_backlight.h" | 34 | #include "lcd_backlight.h" |
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | // use this function to merget both real_mods and oneshot_mods in a uint16_t | 37 | // use this function to merge both real_mods and oneshot_mods in a uint16_t |
| 38 | uint8_t visualizer_get_mods(void); | 38 | uint8_t visualizer_get_mods(void); |
| 39 | 39 | ||
| 40 | // This need to be called once at the start | 40 | // This need to be called once at the start |
| @@ -126,10 +126,6 @@ void stop_keyframe_animation(keyframe_animation_t* animation); | |||
| 126 | // Useful for crossfades for example | 126 | // Useful for crossfades for example |
| 127 | void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state); | 127 | void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state); |
| 128 | 128 | ||
| 129 | // Some predefined keyframe functions that can be used by the user code | ||
| 130 | // Does nothing, useful for adding delays | ||
| 131 | bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); | ||
| 132 | |||
| 133 | // The master can set userdata which will be transferred to the slave | 129 | // The master can set userdata which will be transferred to the slave |
| 134 | #ifdef VISUALIZER_USER_DATA_SIZE | 130 | #ifdef VISUALIZER_USER_DATA_SIZE |
| 135 | void visualizer_set_user_data(void* user_data); | 131 | void visualizer_set_user_data(void* user_data); |
diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk index c9eb8c5bb..799379e3d 100644 --- a/quantum/visualizer/visualizer.mk +++ b/quantum/visualizer/visualizer.mk | |||
| @@ -20,7 +20,8 @@ | |||
| 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 21 | # SOFTWARE. | 21 | # SOFTWARE. |
| 22 | 22 | ||
| 23 | SRC += $(VISUALIZER_DIR)/visualizer.c | 23 | SRC += $(VISUALIZER_DIR)/visualizer.c \ |
| 24 | $(VISUALIZER_DIR)/visualizer_keyframes.c | ||
| 24 | EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR) | 25 | EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR) |
| 25 | GFXLIB = $(LIB_PATH)/ugfx | 26 | GFXLIB = $(LIB_PATH)/ugfx |
| 26 | VPATH += $(VISUALIZER_PATH) | 27 | VPATH += $(VISUALIZER_PATH) |
diff --git a/quantum/visualizer/visualizer_keyframes.c b/quantum/visualizer/visualizer_keyframes.c new file mode 100644 index 000000000..8f6a7e15a --- /dev/null +++ b/quantum/visualizer/visualizer_keyframes.c | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* Copyright 2017 Fred Sundvik | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "visualizer_keyframes.h" | ||
| 18 | |||
| 19 | bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
| 20 | (void)animation; | ||
| 21 | (void)state; | ||
| 22 | return false; | ||
| 23 | } | ||
diff --git a/quantum/visualizer/visualizer_keyframes.h b/quantum/visualizer/visualizer_keyframes.h new file mode 100644 index 000000000..9ef7653c5 --- /dev/null +++ b/quantum/visualizer/visualizer_keyframes.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* Copyright 2017 Fred Sundvik | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_ | ||
| 18 | #define QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_ | ||
| 19 | |||
| 20 | #include "visualizer.h" | ||
| 21 | |||
| 22 | // Some predefined keyframe functions that can be used by the user code | ||
| 23 | // Does nothing, useful for adding delays | ||
| 24 | bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); | ||
| 25 | |||
| 26 | #endif /* QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_ */ | ||
