From 124031aa6a385fc69dd2e72e83a8759d5c9e4357 Mon Sep 17 00:00:00 2001 From: jonylee1986 <2532487686@qq.com> Date: Wed, 8 Mar 2023 15:29:38 +0800 Subject: [PATCH] update m2.c,Make 'RGB_ HUI 'key seven-gear cycle --- keyboards/monsgeek/m2/m2.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/keyboards/monsgeek/m2/m2.c b/keyboards/monsgeek/m2/m2.c index 27d4e31a3c2..a70b0759d16 100644 --- a/keyboards/monsgeek/m2/m2.c +++ b/keyboards/monsgeek/m2/m2.c @@ -470,21 +470,11 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return false; case RGB_HUI: if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { - if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_hue() / (UINT8_MAX / 6)) < 6) { - alarm_cnt = 2; - RGB_HSV_level++; - rgb_matrix_config.hsv.h = (uint8_t)(UINT8_MAX / 6) * RGB_HSV_level; - } - rgb_hsv_updata_user(); - } - return false; - case RGB_HUD: - if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { - if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_hue() / (UINT8_MAX / 6)) > 0) { - alarm_cnt = 2; - RGB_HSV_level--; - rgb_matrix_config.hsv.h = (uint8_t)(UINT8_MAX / 6) * RGB_HSV_level; - } + alarm_cnt = 2; + RGB_HSV_level = (uint8_t)rgb_matrix_get_hue() / (UINT8_MAX / 6); + RGB_HSV_level++; + RGB_HSV_level %= 7; + rgb_matrix_config.hsv.h = (uint8_t)(UINT8_MAX / 6) * RGB_HSV_level; rgb_hsv_updata_user(); } return false;