Skip to content

Commit

Permalink
USB fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BorisTestov committed Jul 6, 2024
1 parent 3f81fc2 commit 3828703
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion keyboards/drop/alt/keymaps/fylch_alt/alt_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ typedef union {
uint32_t raw;
struct {
uint8_t current_layer :4;
uint8_t layer_hue[3]; // Hue on each layer
uint8_t layer_hue[3];
};
} alt_config_t;

Expand Down
3 changes: 2 additions & 1 deletion keyboards/drop/alt/keymaps/fylch_alt/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ along with this program. If not, see <http:https://www.gnu.org/licenses/>.

#pragma once

#define FORCE_NKRO
#define FORCE_NKRO
#define NO_SUSPEND_POWER_DOWN 1
7 changes: 7 additions & 0 deletions keyboards/drop/alt/keymaps/fylch_alt/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "key_processor.h"
#include "layers.h"
#include "tapdance.h"
#include "usb_device_state.h"
#include "utils.h"

#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT
Expand All @@ -19,3 +20,9 @@ void keyboard_post_init_kb(void) {

change_layer(0);
}

__attribute__((weak)) void notify_usb_device_state_change_user(enum usb_device_state usb_device_state) {
if (usb_device_state == USB_DEVICE_STATE_SUSPEND && NO_SUSPEND_POWER_DOWN) {
usb_device_state = USB_DEVICE_STATE_CONFIGURED;
}
}
1 change: 1 addition & 0 deletions keyboards/drop/alt/keymaps/fylch_alt/rules.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
TAP_DANCE_ENABLE = yes
CONSOLE_ENABLE = no
NO_SUSPEND_POWER_DOWN = yes
1 change: 0 additions & 1 deletion keyboards/drop/alt/keymaps/fylch_alt/tapdance.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ void td_ru_finished(tap_dance_state_t *state, void *user_data) {

void td_layer_mod_finished(tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
// We're not saving momentary layers, only persistent layers
change_effect_color(alt_config.layer_hue[1]);
layer_on(1);
} else if (state->count == 2) {
Expand Down

0 comments on commit 3828703

Please sign in to comment.