Skip to content

Commit 466ce0b

Browse files
committed
🩹 Fix displayed mix percentages
1 parent 59a2cb0 commit 466ce0b

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

Marlin/src/feature/mixing.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
#if ENABLED(MIXING_EXTRUDER)
2626

27-
//#define MIXER_NORMALIZER_DEBUG
28-
2927
#include "mixing.h"
3028

3129
Mixer mixer;

Marlin/src/feature/mixing.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ class Mixer {
148148
static void update_mix_from_vtool(const uint8_t j=selected_vtool) {
149149
float ctot = 0;
150150
MIXER_STEPPER_LOOP(i) ctot += color[j][i];
151-
//MIXER_STEPPER_LOOP(i) mix[i] = 100.0f * color[j][i] / ctot;
152-
MIXER_STEPPER_LOOP(i) mix[i] = mixer_perc_t(100.0f * color[j][i] / ctot);
151+
MIXER_STEPPER_LOOP(i) mix[i] = mixer_perc_t(100.0f * color[j][i] / ctot + 0.5f);
153152

154153
#ifdef MIXER_NORMALIZER_DEBUG
155154
SERIAL_ECHOPGM("V-tool ", j, " [ ");

Marlin/src/lcd/menu/menu_mixer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static uint8_t v_index;
112112
#if HAS_DUAL_MIXING
113113
void _lcd_draw_mix(const uint8_t y) {
114114
char tmp[20]; // "100%_100%"
115-
sprintf_P(tmp, PSTR("%3d%% %3d%%"), int(mixer.mix[0]), int(mixer.mix[1]));
115+
sprintf_P(tmp, PSTR("%3d%% %3d%% "), int(mixer.mix[0]), int(mixer.mix[1]));
116116
SETCURSOR(2, y); lcd_put_u8str(GET_TEXT_F(MSG_MIX));
117117
SETCURSOR_RJ(10, y); lcd_put_u8str(tmp);
118118
}

0 commit comments

Comments
 (0)