瀏覽代碼

Fix small hiccup in snake animation (#6858)

theVDude 6 年之前
父節點
當前提交
5a3aefed8d
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      quantum/rgblight.c

+ 3 - 0
quantum/rgblight.c

@@ -910,6 +910,9 @@ void rgblight_effect_snake(animation_status_t *anim) {
         ledp->b        = 0;
         for (j = 0; j < RGBLIGHT_EFFECT_SNAKE_LENGTH; j++) {
             k = pos + j * increment;
+            if (k > RGBLED_NUM) {
+                k = k % RGBLED_NUM;
+            }
             if (k < 0) {
                 k = k + effect_num_leds;
             }