Move M163-M165 MIXING_EXTRUDER to cpp

This commit is contained in:
Scott Lahteine
2017-09-18 00:06:16 -05:00
parent 8ca0b2fd68
commit 1a37ebc76d
10 changed files with 166 additions and 84 deletions

View File

@ -20,6 +20,13 @@
*
*/
#include "../../../inc/MarlinConfig.h"
#if ENABLED(MIXING_EXTRUDER)
#include "../../gcode.h"
#include "../../../feature/mixing.h"
/**
* M163: Set a single mix factor for a mixing extruder
* This is called "weight" by some systems.
@ -28,7 +35,7 @@
* P[float] The mix value
*
*/
void gcode_M163() {
void GcodeSuite::M163() {
const int mix_index = parser.intval('S');
if (mix_index < MIXING_STEPPERS) {
float mix_value = parser.floatval('P');
@ -36,3 +43,5 @@ void gcode_M163() {
mixing_factor[mix_index] = RECIPROCAL(mix_value);
}
}
#endif // MIXING_EXTRUDER

View File

@ -20,13 +20,20 @@
*
*/
#include "../../../inc/MarlinConfig.h"
#if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1
#include "../../gcode.h"
#include "../../../feature/mixing.h"
/**
* M164: Store the current mix factors as a virtual tool.
*
* S[index] The virtual tool to store
*
*/
void gcode_M164() {
void GcodeSuite::M164() {
const int tool_index = parser.intval('S');
if (tool_index < MIXING_VIRTUAL_TOOLS) {
normalize_mix();
@ -34,3 +41,5 @@ void gcode_M164() {
mixing_virtual_tool_mix[tool_index][i] = mixing_factor[i];
}
}
#endif // MIXING_EXTRUDER && MIXING_VIRTUAL_TOOLS > 1

View File

@ -20,6 +20,13 @@
*
*/
#include "../../../inc/MarlinConfig.h"
#if ENABLED(DIRECT_MIXING_IN_G1)
#include "../../gcode.h"
#include "../../../feature/mixing.h"
/**
* M165: Set multiple mix factors for a mixing extruder.
* Factors that are left out will be set to 0.
@ -33,4 +40,6 @@
* I[factor] Mix factor for extruder stepper 6
*
*/
void gcode_M165() { gcode_get_mix(); }
void GcodeSuite::M165() { gcode_get_mix(); }
#endif // DIRECT_MIXING_IN_G1