Reduce firmware size of helix/rev3 (#23324)

master
Joel Challis 2024-03-21 21:54:48 +00:00 committed by GitHub
parent f497c5ee8e
commit ae9c5389f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 72 additions and 52 deletions

View File

@ -87,19 +87,24 @@ static void render_logo(void) {
static void render_rgbled_status(bool full) {
#ifdef RGBLIGHT_ENABLE
char buf[30];
if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) {
if (full) {
snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ",
rgblight_get_mode(),
rgblight_get_hue()/RGBLIGHT_HUE_STEP,
rgblight_get_sat()/RGBLIGHT_SAT_STEP,
rgblight_get_val()/RGBLIGHT_VAL_STEP);
} else {
snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode());
}
oled_write(buf, false);
}
if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) {
if (full) {
// " LED %d:%d,%d,%d"
oled_write_P(PSTR(" LED"), false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(':', false);
oled_write(get_u8_str(rgblight_get_hue() / RGBLIGHT_HUE_STEP, ' '), false);
oled_write_char(',', false);
oled_write(get_u8_str(rgblight_get_sat() / RGBLIGHT_SAT_STEP, ' '), false);
oled_write_char(',', false);
oled_write(get_u8_str(rgblight_get_val() / RGBLIGHT_VAL_STEP, ' '), false);
} else {
// "[%2d]"
oled_write_char('[', false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(']', false);
}
}
#endif
}

View File

@ -87,19 +87,24 @@ static void render_logo(void) {
static void render_rgbled_status(bool full) {
#ifdef RGBLIGHT_ENABLE
char buf[30];
if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) {
if (full) {
snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ",
rgblight_get_mode(),
rgblight_get_hue()/RGBLIGHT_HUE_STEP,
rgblight_get_sat()/RGBLIGHT_SAT_STEP,
rgblight_get_val()/RGBLIGHT_VAL_STEP);
} else {
snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode());
}
oled_write(buf, false);
}
if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) {
if (full) {
// " LED %d:%d,%d,%d"
oled_write_P(PSTR(" LED"), false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(':', false);
oled_write(get_u8_str(rgblight_get_hue() / RGBLIGHT_HUE_STEP, ' '), false);
oled_write_char(',', false);
oled_write(get_u8_str(rgblight_get_sat() / RGBLIGHT_SAT_STEP, ' '), false);
oled_write_char(',', false);
oled_write(get_u8_str(rgblight_get_val() / RGBLIGHT_VAL_STEP, ' '), false);
} else {
// "[%2d]"
oled_write_char('[', false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(']', false);
}
}
#endif
}

View File

@ -87,19 +87,24 @@ static void render_logo(void) {
static void render_rgbled_status(bool full) {
#ifdef RGBLIGHT_ENABLE
char buf[30];
if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) {
if (full) {
snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ",
rgblight_get_mode(),
rgblight_get_hue()/RGBLIGHT_HUE_STEP,
rgblight_get_sat()/RGBLIGHT_SAT_STEP,
rgblight_get_val()/RGBLIGHT_VAL_STEP);
} else {
snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode());
}
oled_write(buf, false);
}
if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) {
if (full) {
// " LED %d:%d,%d,%d"
oled_write_P(PSTR(" LED"), false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(':', false);
oled_write(get_u8_str(rgblight_get_hue() / RGBLIGHT_HUE_STEP, ' '), false);
oled_write_char(',', false);
oled_write(get_u8_str(rgblight_get_sat() / RGBLIGHT_SAT_STEP, ' '), false);
oled_write_char(',', false);
oled_write(get_u8_str(rgblight_get_val() / RGBLIGHT_VAL_STEP, ' '), false);
} else {
// "[%2d]"
oled_write_char('[', false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(']', false);
}
}
#endif
}

View File

@ -86,19 +86,24 @@ static void render_logo(void) {
static void render_rgbled_status(bool full) {
#ifdef RGBLIGHT_ENABLE
char buf[30];
if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) {
if (full) {
snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ",
rgblight_get_mode(),
rgblight_get_hue()/RGBLIGHT_HUE_STEP,
rgblight_get_sat()/RGBLIGHT_SAT_STEP,
rgblight_get_val()/RGBLIGHT_VAL_STEP);
} else {
snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode());
}
oled_write(buf, false);
}
if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) {
if (full) {
// " LED %d:%d,%d,%d"
oled_write_P(PSTR(" LED"), false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(':', false);
oled_write(get_u8_str(rgblight_get_hue() / RGBLIGHT_HUE_STEP, ' '), false);
oled_write_char(',', false);
oled_write(get_u8_str(rgblight_get_sat() / RGBLIGHT_SAT_STEP, ' '), false);
oled_write_char(',', false);
oled_write(get_u8_str(rgblight_get_val() / RGBLIGHT_VAL_STEP, ' '), false);
} else {
// "[%2d]"
oled_write_char('[', false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(']', false);
}
}
#endif
}