You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
772 B

  1. #ifndef DISABLE_RGB_MATRIX_CYCLE_PINWHEEL
  2. RGB_MATRIX_EFFECT(CYCLE_PINWHEEL)
  3. #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
  4. bool CYCLE_PINWHEEL(effect_params_t* params) {
  5. RGB_MATRIX_USE_LIMITS(led_min, led_max);
  6. HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val };
  7. uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4);
  8. for (uint8_t i = led_min; i < led_max; i++) {
  9. RGB_MATRIX_TEST_LED_FLAGS();
  10. int16_t dx = g_led_config.point[i].x - 112;
  11. int16_t dy = g_led_config.point[i].y - 32;
  12. hsv.h = atan2_8(dy, dx) + time;
  13. RGB rgb = hsv_to_rgb(hsv);
  14. rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
  15. }
  16. return led_max < DRIVER_LED_TOTAL;
  17. }
  18. #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
  19. #endif // DISABLE_RGB_MATRIX_CYCLE_PINWHEEL