diff options
author | Nick Brassel <nick@tzarc.org> | 2021-01-03 15:26:43 +1100 |
---|---|---|
committer | Nick Brassel <nick@tzarc.org> | 2021-01-03 15:26:43 +1100 |
commit | 271c0cf136c5dd5b9456d8b79272e67bc1a13cea (patch) | |
tree | c2b6eec8c298acc0de000e980d806f68dbe84482 /quantum | |
parent | e8e090acede2596e19de40628543f4ed27d33ab0 (diff) | |
parent | f3ac792c096c10c9dd5004e6e06aad60710ef599 (diff) |
Merge remote-tracking branch 'upstream/master' into develop
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/rgblight.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 3297f3a710..d277029e4b 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -628,7 +628,7 @@ void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_set #ifdef RGBLIGHT_LAYERS void rgblight_set_layer_state(uint8_t layer, bool enabled) { - rgblight_layer_mask_t mask = 1 << layer; + rgblight_layer_mask_t mask = (rgblight_layer_mask_t)1 << layer; if (enabled) { rgblight_status.enabled_layer_mask |= mask; } else { @@ -649,7 +649,7 @@ void rgblight_set_layer_state(uint8_t layer, bool enabled) { } bool rgblight_get_layer_state(uint8_t layer) { - rgblight_layer_mask_t mask = 1 << layer; + rgblight_layer_mask_t mask = (rgblight_layer_mask_t)1 << layer; return (rgblight_status.enabled_layer_mask & mask) != 0; } @@ -688,14 +688,14 @@ static uint16_t _blink_timer; void rgblight_blink_layer(uint8_t layer, uint16_t duration_ms) { rgblight_set_layer_state(layer, true); - _blinked_layer_mask |= 1 << layer; + _blinked_layer_mask |= (rgblight_layer_mask_t)1 << layer; _blink_timer = sync_timer_read() + duration_ms; } void rgblight_unblink_layers(void) { if (_blinked_layer_mask != 0 && timer_expired(sync_timer_read(), _blink_timer)) { for (uint8_t layer = 0; layer < RGBLIGHT_MAX_LAYERS; layer++) { - if ((_blinked_layer_mask & 1 << layer) != 0) { + if ((_blinked_layer_mask & (rgblight_layer_mask_t)1 << layer) != 0) { rgblight_set_layer_state(layer, false); } } |