rgblight: Limit max repeat times in rgblight_blink_layer_repeat (#16860)

master
Simon Arlott 2022-04-16 18:40:48 +01:00 committed by GitHub
parent b331c98ca4
commit 1cfe49714f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -813,6 +813,10 @@ void rgblight_blink_layer(uint8_t layer, uint16_t duration_ms) {
}
void rgblight_blink_layer_repeat(uint8_t layer, uint16_t duration_ms, uint8_t times) {
if (times > UINT8_MAX / 2) {
times = UINT8_MAX / 2;
}
_times_remaining = times * 2;
_dur = duration_ms;