Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ARM pgm_read_word workaround in rgblight #16961

Merged
merged 2 commits into from
Apr 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions quantum/rgblight/rgblight.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,8 @@ void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool w
// static gradient
uint8_t delta = rgblight_config.mode - rgblight_status.base_mode;
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_word(&RGBLED_GRADIENT_RANGES[delta / 2]);
# else
uint8_t range = RGBLED_GRADIENT_RANGES[delta / 2];
# endif

uint8_t range = pgm_read_byte(&RGBLED_GRADIENT_RANGES[delta / 2]);
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;
if (direction) {
Expand Down