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,18 +87,23 @@ 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);
// " 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 {
snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode());
// "[%2d]"
oled_write_char('[', false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(']', false);
}
oled_write(buf, false);
}
#endif
}

View File

@ -87,18 +87,23 @@ 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);
// " 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 {
snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode());
// "[%2d]"
oled_write_char('[', false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(']', false);
}
oled_write(buf, false);
}
#endif
}

View File

@ -87,18 +87,23 @@ 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);
// " 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 {
snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode());
// "[%2d]"
oled_write_char('[', false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(']', false);
}
oled_write(buf, false);
}
#endif
}

View File

@ -86,18 +86,23 @@ 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);
// " 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 {
snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode());
// "[%2d]"
oled_write_char('[', false);
oled_write(get_u8_str(rgblight_get_mode(), ' '), false);
oled_write_char(']', false);
}
oled_write(buf, false);
}
#endif
}