qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

solid_splash_anim.h (1200B)


      1 #ifdef LED_MATRIX_KEYREACTIVE_ENABLED
      2 #    if defined(ENABLE_LED_MATRIX_SOLID_SPLASH) || defined(ENABLE_LED_MATRIX_SOLID_MULTISPLASH)
      3 
      4 #        ifdef ENABLE_LED_MATRIX_SOLID_SPLASH
      5 LED_MATRIX_EFFECT(SOLID_SPLASH)
      6 #        endif
      7 
      8 #        ifdef ENABLE_LED_MATRIX_SOLID_MULTISPLASH
      9 LED_MATRIX_EFFECT(SOLID_MULTISPLASH)
     10 #        endif
     11 
     12 #        ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
     13 
     14 uint8_t SOLID_SPLASH_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
     15     uint16_t effect = tick - dist;
     16     if (effect > 255) effect = 255;
     17     return qadd8(val, 255 - effect);
     18 }
     19 
     20 #            ifdef ENABLE_LED_MATRIX_SOLID_SPLASH
     21 bool SOLID_SPLASH(effect_params_t* params) {
     22     return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_SPLASH_math);
     23 }
     24 #            endif
     25 
     26 #            ifdef ENABLE_LED_MATRIX_SOLID_MULTISPLASH
     27 bool SOLID_MULTISPLASH(effect_params_t* params) {
     28     return effect_runner_reactive_splash(0, params, &SOLID_SPLASH_math);
     29 }
     30 #            endif
     31 
     32 #        endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
     33 #    endif     // defined(ENABLE_LED_MATRIX_SPLASH) || defined(ENABLE_LED_MATRIX_MULTISPLASH)
     34 #endif         // LED_MATRIX_KEYREACTIVE_ENABLED