Skip to content

Commit

Permalink
🩹 Fix displayed mix percentages
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 30, 2023
1 parent 49f1cc8 commit c91f3a7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions Marlin/src/feature/mixing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

#if ENABLED(MIXING_EXTRUDER)

//#define MIXER_NORMALIZER_DEBUG

#include "mixing.h"

Mixer mixer;
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/feature/mixing.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ class Mixer {
static void update_mix_from_vtool(const uint8_t j=selected_vtool) {
float ctot = 0;
MIXER_STEPPER_LOOP(i) ctot += color[j][i];
//MIXER_STEPPER_LOOP(i) mix[i] = 100.0f * color[j][i] / ctot;
MIXER_STEPPER_LOOP(i) mix[i] = mixer_perc_t(100.0f * color[j][i] / ctot);
MIXER_STEPPER_LOOP(i) mix[i] = mixer_perc_t(100.0f * color[j][i] / ctot + 0.5f);

#ifdef MIXER_NORMALIZER_DEBUG
SERIAL_ECHOPGM("V-tool ", j, " [ ");
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static uint8_t v_index;
#if HAS_DUAL_MIXING
void _lcd_draw_mix(const uint8_t y) {
char tmp[20]; // "100%_100%"
sprintf_P(tmp, PSTR("%3d%% %3d%%"), int(mixer.mix[0]), int(mixer.mix[1]));
sprintf_P(tmp, PSTR("%3d%% %3d%% "), int(mixer.mix[0]), int(mixer.mix[1]));
SETCURSOR(2, y); lcd_put_u8str(GET_TEXT_F(MSG_MIX));
SETCURSOR_RJ(10, y); lcd_put_u8str(tmp);
}
Expand Down

0 comments on commit c91f3a7

Please sign in to comment.