Skip to content

Commit

Permalink
Update for breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed May 30, 2021
1 parent a036422 commit 243b9fa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 35 deletions.
6 changes: 4 additions & 2 deletions keyboards/work_louder/encoder_actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "encoder_actions.h"

#if defined(VIA_ENABLE) && defined(ENCODERS_ENABLE)
#if defined(VIA_ENABLE) && defined(ENCODER_ENABLE)

# ifdef ENCODERS
static uint8_t encoder_state[ENCODERS] = {0};
Expand Down Expand Up @@ -58,9 +58,11 @@ void matrix_scan_kb(void) {
matrix_scan_user();
}

void encoder_update_kb(uint8_t index, bool clockwise) {
bool encoder_update_kb(uint8_t index, bool clockwise) {
encoder_action_register(index, clockwise);
// don't return user actions, because they are in the keymap
// encoder_update_user(index, clockwise);
return true;
};

#endif
15 changes: 4 additions & 11 deletions keyboards/work_louder/loop/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@

#include "loop.h"

#ifdef ENCODER_ENABLE
__attribute__((weak)) void encoder_update_user(uint8_t index, bool clockwise) {
#if !defined(VIA_ENABLE) && defined(ENCODER_ENABLE)
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; }
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLD);
Expand All @@ -37,6 +38,7 @@ __attribute__((weak)) void encoder_update_user(uint8_t index, bool clockwise) {
rgb_matrix_step();
}
}
return true;
}
#endif

Expand All @@ -51,13 +53,4 @@ led_config_t g_led_config = {
}
};

void suspend_power_down_kb(void) {
rgb_matrix_set_suspend_state(true);
suspend_power_down_user();
}

void suspend_wakeup_init_kb(void) {
rgb_matrix_set_suspend_state(false);
suspend_wakeup_init_user();
}
#endif
15 changes: 4 additions & 11 deletions keyboards/work_louder/nano/nano.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

#include "nano.h"

#ifdef ENCODER_ENABLE
__attribute__((weak)) void encoder_update_user(uint8_t index, bool clockwise) {
#if !defined(VIA_ENABLE) && defined(ENCODER_ENABLE)
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; }
if (clockwise) {
tap_code(KC_PGDN);
} else {
tap_code(KC_PGUP);
}
return true;
}
#endif

Expand All @@ -37,13 +39,4 @@ led_config_t g_led_config = {
}
};

void suspend_power_down_kb(void) {
rgb_matrix_set_suspend_state(true);
suspend_power_down_user();
}

void suspend_wakeup_init_kb(void) {
rgb_matrix_set_suspend_state(false);
suspend_wakeup_init_user();
}
#endif
15 changes: 4 additions & 11 deletions keyboards/work_louder/work_board/work_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

#include "work_board.h"

#ifdef ENCODER_ENABLE
__attribute__((weak)) void encoder_update_user(uint8_t index, bool clockwise) {
#if !defined(VIA_ENABLE) && defined(ENCODER_ENABLE)
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; }
if (clockwise) {
tap_code(KC_VOLD);
} else {
tap_code(KC_VOLU);
}
return true;
}
#endif

Expand Down Expand Up @@ -88,13 +90,4 @@ led_config_t g_led_config = { {
1, 1, 1, 1, 1, 4,4,4, 1, 1, 1, 1, 1
} };

void suspend_power_down_kb(void) {
rgb_matrix_set_suspend_state(true);
suspend_power_down_user();
}

void suspend_wakeup_init_kb(void) {
rgb_matrix_set_suspend_state(false);
suspend_wakeup_init_user();
}
#endif

0 comments on commit 243b9fa

Please sign in to comment.