Sfoglia il codice sorgente

Add RGB matrix suspend wake function for Planck/rev6 (#12290)

* Add RGB matrix suspend wake function for Planck/rev6

* Update suggested definition to allow user override.

Co-authored-by: Nick Brassel <nick@tzarc.org>

Co-authored-by: filterpaper <filterpaper@localhost>
Co-authored-by: Nick Brassel <nick@tzarc.org>
Albert Y 4 anni fa
parent
commit
c7ca67a036
2 ha cambiato i file con 14 aggiunte e 0 eliminazioni
  1. 4 0
      keyboards/planck/rev6/config.h
  2. 10 0
      keyboards/planck/rev6/rev6.c

+ 4 - 0
keyboards/planck/rev6/config.h

@@ -140,4 +140,8 @@
 #define WS2812_DMA_STREAM STM32_DMA1_STREAM2
 #define WS2812_DMA_CHANNEL 2
 
+#ifndef RGB_DISABLE_WHEN_USB_SUSPENDED
+#    define RGB_DISABLE_WHEN_USB_SUSPENDED true
+#endif
+
 #endif

+ 10 - 0
keyboards/planck/rev6/rev6.c

@@ -39,6 +39,16 @@ led_config_t g_led_config = { {
 //     6 5 4 3
 //        0
 //     7 8 1 2
+
+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
 
 void matrix_init_kb(void) {