Remove ARM pgm_read_word workaround in rgblight (#16961)
This commit is contained in:
parent
6e819945ed
commit
ef8db9f104
@ -559,12 +559,8 @@ void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool w
|
|||||||
// static gradient
|
// static gradient
|
||||||
uint8_t delta = rgblight_config.mode - rgblight_status.base_mode;
|
uint8_t delta = rgblight_config.mode - rgblight_status.base_mode;
|
||||||
bool direction = (delta % 2) == 0;
|
bool direction = (delta % 2) == 0;
|
||||||
# ifdef __AVR__
|
|
||||||
// probably due to how pgm_read_word is defined for ARM, but the ARM compiler really hates this line
|
uint8_t range = pgm_read_byte(&RGBLED_GRADIENT_RANGES[delta / 2]);
|
||||||
uint8_t range = pgm_read_word(&RGBLED_GRADIENT_RANGES[delta / 2]);
|
|
||||||
# else
|
|
||||||
uint8_t range = RGBLED_GRADIENT_RANGES[delta / 2];
|
|
||||||
# endif
|
|
||||||
for (uint8_t i = 0; i < rgblight_ranges.effect_num_leds; i++) {
|
for (uint8_t i = 0; i < rgblight_ranges.effect_num_leds; i++) {
|
||||||
uint8_t _hue = ((uint16_t)i * (uint16_t)range) / rgblight_ranges.effect_num_leds;
|
uint8_t _hue = ((uint16_t)i * (uint16_t)range) / rgblight_ranges.effect_num_leds;
|
||||||
if (direction) {
|
if (direction) {
|
||||||
|
Loading…
Reference in New Issue
Block a user