Skip to content

Commit

Permalink
Update Helix 'led_test' keymap
Browse files Browse the repository at this point in the history
Change to use keyboard_post_init_user() hook (qmk#3113)
  • Loading branch information
mtei authored and zer09 committed Feb 24, 2019
1 parent 336c903 commit 3c2ecb6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
7 changes: 0 additions & 7 deletions keyboards/helix/rev2/keymaps/default/keymap.c
Expand Up @@ -506,14 +506,7 @@ void music_scale_user(void)
//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
#ifdef SSD1306OLED

// hook point for 'led_test' keymap
// 'default' keymap's led_test_init() is empty function, do nothing
// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST);
__attribute__ ((weak))
void led_test_init(void) {}

void matrix_scan_user(void) {
led_test_init();
iota_gfx_task(); // this is what updates the display continuously
}

Expand Down
16 changes: 1 addition & 15 deletions keyboards/helix/rev2/keymaps/led_test/led_test_init.c
@@ -1,20 +1,6 @@
#include QMK_KEYBOARD_H

#if 1
void led_test_init(void) {
static int scan_count = 0;
if( scan_count == 2 ) {
rgblight_enable_noeeprom();
rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST);
}
if( scan_count < 3 ) scan_count ++;
}

#else
// when qmk/qmk_firmware PullRequest #3113 available.
// can use this?
void startup_user(void) {
void keyboard_post_init_user(void) {
rgblight_enable_noeeprom();
rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST);
}
#endif

0 comments on commit 3c2ecb6

Please sign in to comment.