summaryrefslogtreecommitdiff
path: root/keyboards/xelus/valor/rev2/rgb_matrix_kb.inc
blob: 35184060904d0ee06ad0dfc8d2f4ae7913bb8e36 (plain)
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