Prusa MINI Firmware overview
Mixer Class Reference

Mixer class. More...

#include <mixing.h>

Collaboration diagram for Mixer:

Static Public Member Functions

static void init ()
 
static void reset_vtools ()
 
static void refresh_collector (const float proportion=1.0, const uint8_t t=selected_vtool, float(&c)[MIXING_STEPPERS]=collector)
 
static FORCE_INLINE void set_collector (const uint8_t c, const float f)
 
static void normalize (const uint8_t tool_index)
 
static FORCE_INLINE void normalize ()
 
static FORCE_INLINE uint8_t get_current_vtool ()
 
static FORCE_INLINE void T (const uint_fast8_t c)
 
static FORCE_INLINE void populate_block (mixer_comp_t b_color[MIXING_STEPPERS])
 
static FORCE_INLINE void stepper_setup (mixer_comp_t b_color[MIXING_STEPPERS])
 
static FORCE_INLINE uint8_t get_stepper ()
 
static FORCE_INLINE uint8_t get_next_stepper ()
 

Static Public Attributes

static float collector [MIXING_STEPPERS]
 

Detailed Description

Mixer class.

Contains data and behaviors for a Mixing Extruder

Member Function Documentation

◆ init()

static void Mixer::init ( )
static
Here is the caller graph for this function:

◆ reset_vtools()

static void Mixer::reset_vtools ( )
static

◆ refresh_collector()

static void Mixer::refresh_collector ( const float  proportion = 1.0,
const uint8_t  t = selected_vtool,
float(&)  c[MIXING_STEPPERS] = collector 
)
static
Here is the caller graph for this function:

◆ set_collector()

static FORCE_INLINE void Mixer::set_collector ( const uint8_t  c,
const float  f 
)
static
106 { collector[c] = _MAX(f, 0.0f); }

◆ normalize() [1/2]

static void Mixer::normalize ( const uint8_t  tool_index)
static

◆ normalize() [2/2]

static FORCE_INLINE void Mixer::normalize ( )
static
109 { normalize(selected_vtool); }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_current_vtool()

static FORCE_INLINE uint8_t Mixer::get_current_vtool ( )
static
111 { return selected_vtool; }
Here is the caller graph for this function:

◆ T()

static FORCE_INLINE void Mixer::T ( const uint_fast8_t  c)
static
113  {
114  selected_vtool = c;
115  #if ENABLED(GRADIENT_VTOOL)
116  refresh_gradient();
117  #endif
118  #if DUAL_MIXING_EXTRUDER
119  update_mix_from_vtool();
120  #endif
121  }
Here is the caller graph for this function:

◆ populate_block()

static FORCE_INLINE void Mixer::populate_block ( mixer_comp_t  b_color[MIXING_STEPPERS])
static
124  {
125  #if ENABLED(GRADIENT_MIX)
126  if (gradient.enabled) {
127  MIXER_STEPPER_LOOP(i) b_color[i] = gradient.color[i];
128  return;
129  }
130  #endif
131  MIXER_STEPPER_LOOP(i) b_color[i] = color[selected_vtool][i];
132  }

◆ stepper_setup()

static FORCE_INLINE void Mixer::stepper_setup ( mixer_comp_t  b_color[MIXING_STEPPERS])
static
134  {
135  MIXER_STEPPER_LOOP(i) s_color[i] = b_color[i];
136  }

◆ get_stepper()

static FORCE_INLINE uint8_t Mixer::get_stepper ( )
static
247 { return runner; }
Here is the caller graph for this function:

◆ get_next_stepper()

static FORCE_INLINE uint8_t Mixer::get_next_stepper ( )
static
248  {
249  for (;;) {
250  if (--runner < 0) runner = MIXING_STEPPERS - 1;
251  accu[runner] += s_color[runner];
252  if (
253  #ifdef MIXER_ACCU_SIGNED
254  accu[runner] < 0
255  #else
256  accu[runner] & COLOR_A_MASK
257  #endif
258  ) {
259  accu[runner] &= COLOR_MASK;
260  return runner;
261  }
262  }
263  }
Here is the caller graph for this function:

Member Data Documentation

◆ collector

float Mixer::collector[MIXING_STEPPERS]
static
_MAX
#define _MAX(V...)
Definition: macros.h:346
COLOR_A_MASK
#define COLOR_A_MASK
Definition: mixing.h:32
i
uint8_t i
Definition: screen_test_graph.c:72
Mixer::normalize
static FORCE_INLINE void normalize()
Definition: mixing.h:109
COLOR_MASK
#define COLOR_MASK
Definition: mixing.h:33
MIXER_STEPPER_LOOP
#define MIXER_STEPPER_LOOP(VAR)
Definition: mixing.h:68
Mixer::collector
static float collector[MIXING_STEPPERS]
Definition: mixing.h:98