]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/hadron/ver3/ver3.c
Updated rgb_led struct field modifier to flags (#5619)
[qmk_firmware.git] / keyboards / hadron / ver3 / ver3.c
index 5e5e3e009f83f44072536521d85bb5a840884262..5827b42e20f370c5d05363ab25d431589ea281b1 100644 (file)
 #include "ver3.h"
 #include "qwiic.h"
 #include "action_layer.h"
-#include "matrix.h"
-#include "DRV2605L.h"
+#include "haptic.h"
+
+#ifdef RGB_MATRIX_ENABLE
+#include "rgblight.h"
+
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+  /*{row | col << 4}
+    |             {x=0..224, y=0..64}
+    |              |         modifier
+    |              |         | */
+  {{1|(13<<4)},   {195, 3},  4},
+  {{4|(13<<4)},   {195, 16}, 4},
+  {{4|(10<<4)},   {150, 16}, 4},
+  {{4|(7<<4)},    {105, 16}, 4},
+  {{4|(4<<4)},    {60,  16}, 4},
+  {{4|(1<<4)},    {15,  16}, 4},
+  {{1|(1<<4)},    {15,  3},  4},
+  {{1|(4<<4)},    {60,  3},  4},
+  {{1|(7<<4)},    {105, 3},  4},
+  {{1|(10<<4)},   {150, 3},  4}
+};
+
+#endif
+
+uint8_t *o_fb;
+
+uint16_t counterst = 0;
+
+
 
 #ifdef QWIIC_MICRO_OLED_ENABLE
 
@@ -41,7 +68,7 @@ void draw_ui(void) {
   send_command(DISPLAYON);
 
 /* Layer indicator is 41 x 10 pixels */
-#define LAYER_INDICATOR_X 0
+#define LAYER_INDICATOR_X 5
 #define LAYER_INDICATOR_Y 0 
 
   draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0);
@@ -49,7 +76,7 @@ void draw_ui(void) {
   draw_char(LAYER_INDICATOR_X + 34, LAYER_INDICATOR_Y + 2, layer + 0x30, PIXEL_ON, XOR, 0);
 
 /* Matrix display is 19 x 9 pixels */
-#define MATRIX_DISPLAY_X 0
+#define MATRIX_DISPLAY_X 5
 #define MATRIX_DISPLAY_Y 18
 
   for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
@@ -167,20 +194,12 @@ void encoder_update_kb(uint8_t index, bool clockwise) {
 #endif
 
 void matrix_init_kb(void) {
-#ifdef DRV2605L
-  DRV_init();
-#endif
   queue_for_send = true;
        matrix_init_user();
 }
             
 void matrix_scan_kb(void) {
-
 if (queue_for_send) {
-  #ifdef DRV2605L
-    DRV_EFFECT play_eff = strong_click; 
-    DRV_pulse(play_eff);
-  #endif
 #ifdef QWIIC_MICRO_OLED_ENABLE
    read_host_led_state();
    draw_ui();
@@ -192,5 +211,10 @@ if (queue_for_send) {
   send_command(DISPLAYOFF);      /* 0xAE */
   }
 #endif
+  if (counterst == 0) {
+    //testPatternFB(o_fb);
+  }
+  counterst = (counterst + 1) % 1024;
+  //rgblight_task();
        matrix_scan_user();
 }