Procházet zdrojové kódy

[Keyboard] Dimple: fix unintended LED behaviour (#6046)

* Dimple: fix unintended LED behaviour

The LED was always-on if the custom keymap did not call dimple_led_off()
at least once.

* Dimple: LED code fixup
Erovia před 6 roky
rodič
revize
a678f4a206
1 změnil soubory, kde provedl 8 přidání a 2 odebrání
  1. 8 2
      keyboards/lazydesigners/dimple/dimple.c

+ 8 - 2
keyboards/lazydesigners/dimple/dimple.c

@@ -16,9 +16,15 @@
 #include "dimple.h"
 #include "dimple.h"
 
 
 void dimple_led_on() {
 void dimple_led_on() {
-  DDRE |= (1 << 6); PORTE &= ~(1 << 6);
+  writePinHigh(E6);
 }
 }
 
 
 void dimple_led_off() {
 void dimple_led_off() {
-  DDRE &= ~(1 << 6); PORTE &= ~(1 << 6);
+  writePinLow(E6);
+}
+
+void keyboard_pre_init_kb(void) {
+  // Initialize Caps Lock LED
+  setPinOutput(E6);
+  keyboard_pre_init_user();
 }
 }