diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-07-07 09:59:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-07 09:59:33 -0400 |
commit | ad43d450ca1b988d196da80e2a745f45f24068f6 (patch) | |
tree | a479c21240dba88cd593e85cac6926b17924984d /tmk_core | |
parent | 589df84d6cd19ad7d776cc19bcddade1cd178ddc (diff) | |
parent | caedec92d2c22480313c43a364408fb920c55364 (diff) |
Merge pull request #490 from fredizzimo/integrate_visualizer
Integrate visualizer for ChibiOS and Infinity Ergodox
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/common/keyboard.c | 8 | ||||
-rw-r--r-- | tmk_core/protocol/chibios/main.c | 15 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 3a1262a9f9..c46a701b3b 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -29,6 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "sendchar.h" #include "eeconfig.h" #include "backlight.h" +#include "action_layer.h" #ifdef BOOTMAGIC_ENABLE # include "bootmagic.h" #else @@ -52,6 +53,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #ifdef SERIAL_LINK_ENABLE # include "serial_link/system/serial_link.h" #endif +#ifdef VISUALIZER_ENABLE +# include "visualizer/visualizer.h" +#endif #ifdef MATRIX_HAS_GHOST static bool has_ghost_in_row(uint8_t row) @@ -181,6 +185,10 @@ MATRIX_LOOP_END: serial_link_update(); #endif +#ifdef VISUALIZER_ENABLE + visualizer_update(default_layer_state, layer_state, host_keyboard_leds()); +#endif + // update LED if (led_status != host_keyboard_leds()) { led_status = host_keyboard_leds(); diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index aeb11752f4..b0eb9aef81 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -38,6 +38,9 @@ #ifdef SERIAL_LINK_ENABLE #include "serial_link/system/serial_link.h" #endif +#ifdef VISUALIZER_ENABLE +#include "visualizer/visualizer.h" +#endif #include "suspend.h" @@ -105,6 +108,11 @@ int main(void) { init_serial_link(); #endif +#ifdef VISUALIZER_ENABLE + visualizer_init(); +#endif + + host_driver_t* driver = NULL; /* Wait until the USB or serial link is active */ @@ -147,6 +155,9 @@ int main(void) { if(USB_DRIVER.state == USB_SUSPENDED) { print("[s]"); +#ifdef VISUALIZER_ENABLE + visualizer_suspend(); +#endif while(USB_DRIVER.state == USB_SUSPENDED) { /* Do this in the suspended state */ #ifdef SERIAL_LINK_ENABLE @@ -164,6 +175,10 @@ int main(void) { #ifdef MOUSEKEY_ENABLE mousekey_send(); #endif /* MOUSEKEY_ENABLE */ + +#ifdef VISUALIZER_ENABLE + visualizer_resume(); +#endif } keyboard_task(); |