Skip to content

Commit 1cfe497

Browse files
authored
rgblight: Limit max repeat times in rgblight_blink_layer_repeat (#16860)
1 parent b331c98 commit 1cfe497

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

quantum/rgblight/rgblight.c

+4
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,10 @@ void rgblight_blink_layer(uint8_t layer, uint16_t duration_ms) {
813813
}
814814

815815
void rgblight_blink_layer_repeat(uint8_t layer, uint16_t duration_ms, uint8_t times) {
816+
if (times > UINT8_MAX / 2) {
817+
times = UINT8_MAX / 2;
818+
}
819+
816820
_times_remaining = times * 2;
817821
_dur = duration_ms;
818822

0 commit comments

Comments
 (0)