From bb6174524f5f2382cf77ccec276d2ce7e1eb848e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 Mar 2015 02:08:57 -0700 Subject: [PATCH] Fix EXTRUDER_OFFSET compiler error - Addressing issue #1741 --- Marlin/Marlin_main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 86138fb8f9..caeb628b2d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -229,18 +229,17 @@ bool axis_known_position[3] = { false }; // Extruder offset #if EXTRUDERS > 1 #ifndef EXTRUDER_OFFSET_X - #define EXTRUDER_OFFSET_X 0 + #define EXTRUDER_OFFSET_X { 0 } #endif #ifndef EXTRUDER_OFFSET_Y - #define EXTRUDER_OFFSET_Y 0 + #define EXTRUDER_OFFSET_Y { 0 } #endif #ifndef DUAL_X_CARRIAGE #define NUM_EXTRUDER_OFFSETS 2 // only in XY plane #else #define NUM_EXTRUDER_OFFSETS 3 // supports offsets in XYZ plane #endif - #define _EXY { EXTRUDER_OFFSET_X, EXTRUDER_OFFSET_Y } - float extruder_offset[EXTRUDERS][NUM_EXTRUDER_OFFSETS] = ARRAY_BY_EXTRUDERS(_EXY, _EXY, _EXY, _EXY); + float extruder_offset[EXTRUDERS][NUM_EXTRUDER_OFFSETS]; #endif uint8_t active_extruder = 0; @@ -569,6 +568,13 @@ void servo_init() void setup() { + #if EXTRUDERS > 1 + float offset[3][EXTRUDERS] = { EXTRUDER_OFFSET_X, EXTRUDER_OFFSET_Y, ARRAY_BY_EXTRUDERS(0,0,0,0) }; + for (int e=0; e