~ruther/qmk_firmware

ref: 9777b5f2c3e5fbd37a45d39a2662b46327f72fdd qmk_firmware/keyboards/xelus/valor/rev2/rgb_matrix_kb.inc -rw-r--r-- 924 bytes
9777b5f2 — Rutherther chore: update drawer config 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Step 1.
// Declare custom effects using the RGB_MATRIX_EFFECT macro
// (note the lack of semicolon after the macro!)
RGB_MATRIX_EFFECT(test_mode)

// Step 2.
// Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS

// e.g: A simple effect, self-contained within a single method
static bool test_mode(effect_params_t* params) {
    uint8_t factor = 9;
    switch ((g_rgb_timer & (0b11 << factor)) >> factor) {
        case 0: {
            rgb_matrix_set_color_all(150, 0, 0);
            break;
        }
        case 1: {
            rgb_matrix_set_color_all(0, 150, 0);
            break;
        }
        case 2: {
            rgb_matrix_set_color_all(0, 0, 150);
            break;
        }
        case 3: {
            rgb_matrix_set_color_all(150, 150, 150);
            break;
        }
    }
    return false;
}

#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
Do not follow this link