Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
9f3e404f
Commit
9f3e404f
authored
Feb 16, 2016
by
MagoKimbra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
parent
f8279b07
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
136 additions
and
56 deletions
+136
-56
MK_Main.cpp
MK/module/MK_Main.cpp
+91
-3
planner.cpp
MK/module/motion/planner.cpp
+2
-2
stepper.cpp
MK/module/motion/stepper.cpp
+15
-37
stepper.h
MK/module/motion/stepper.h
+28
-14
No files found.
MK/module/MK_Main.cpp
View file @
9f3e404f
...
@@ -30,6 +30,10 @@
...
@@ -30,6 +30,10 @@
#include "../base.h"
#include "../base.h"
#if ENABLED(RFID_MODULE)
MFRC522
RFID522
;
#endif
#if ENABLED(M100_FREE_MEMORY_WATCHER)
#if ENABLED(M100_FREE_MEMORY_WATCHER)
void
gcode_M100
();
void
gcode_M100
();
#endif
#endif
...
@@ -125,6 +129,13 @@ double printer_usage_filament;
...
@@ -125,6 +129,13 @@ double printer_usage_filament;
int
old_color
=
99
;
int
old_color
=
99
;
#endif
#endif
#if ENABLED(RFID_MODULE)
bool
RFID_ON
=
false
;
unsigned
long
Spool_ID
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
0
);
bool
Spool_must_read
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
false
);
bool
Spool_must_write
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
false
);
#endif
#if HAS(SERVO_ENDSTOPS)
#if HAS(SERVO_ENDSTOPS)
const
int
servo_endstop_id
[]
=
SERVO_ENDSTOP_IDS
;
const
int
servo_endstop_id
[]
=
SERVO_ENDSTOP_IDS
;
const
int
servo_endstop_angle
[][
2
]
=
{
X_ENDSTOP_SERVO_ANGLES
,
Y_ENDSTOP_SERVO_ANGLES
,
Z_ENDSTOP_SERVO_ANGLES
};
const
int
servo_endstop_angle
[][
2
]
=
{
X_ENDSTOP_SERVO_ANGLES
,
Y_ENDSTOP_SERVO_ANGLES
,
Z_ENDSTOP_SERVO_ANGLES
};
...
@@ -657,6 +668,12 @@ void setup() {
...
@@ -657,6 +668,12 @@ void setup() {
setup_statled
();
setup_statled
();
#endif
#endif
#if ENABLED(RFID_MODULE)
RFID_ON
=
RFID522
.
init
();
if
(
RFID_ON
)
ECHO_LM
(
INFO
,
"RFID CONNECT"
);
#endif
#if ENABLED(FIRMWARE_TEST)
#if ENABLED(FIRMWARE_TEST)
FirmwareTest
();
FirmwareTest
();
#endif
#endif
...
@@ -2518,7 +2535,7 @@ static void clean_up_after_endstop_move() {
...
@@ -2518,7 +2535,7 @@ static void clean_up_after_endstop_move() {
const
char
*
mixing_codes
=
"ABCDHI"
;
const
char
*
mixing_codes
=
"ABCDHI"
;
float
mix_total
=
0.0
;
float
mix_total
=
0.0
;
for
(
int8_t
e
=
0
;
e
<
DRIVER_EXTRUDERS
;
e
++
)
{
for
(
int8_t
e
=
0
;
e
<
DRIVER_EXTRUDERS
;
e
++
)
{
float
v
=
code_seen
(
mixing_codes
[
e
])
?
code_value
()
:
0
;
float
v
=
code_seen
(
mixing_codes
[
e
])
?
code_value
()
:
mixing_factor
[
e
]
;
mixing_factor
[
e
]
=
v
;
mixing_factor
[
e
]
=
v
;
mix_total
+=
v
;
mix_total
+=
v
;
}
}
...
@@ -2826,6 +2843,10 @@ void gcode_get_destination() {
...
@@ -2826,6 +2843,10 @@ void gcode_get_destination() {
printer_usage_filament
+=
(
destination
[
E_AXIS
]
-
current_position
[
E_AXIS
]);
printer_usage_filament
+=
(
destination
[
E_AXIS
]
-
current_position
[
E_AXIS
]);
#if ENABLED(RFID_MODULE)
RFID522
.
RfidData
[
active_extruder
].
data
.
lenght
-=
(
destination
[
E_AXIS
]
-
current_position
[
E_AXIS
]);
#endif
#if ENABLED(NEXTION) && ENABLED(NEXTION_GFX)
#if ENABLED(NEXTION) && ENABLED(NEXTION_GFX)
if
((
code_seen
(
axis_codes
[
X_AXIS
])
||
code_seen
(
axis_codes
[
Y_AXIS
]))
&&
code_seen
(
axis_codes
[
E_AXIS
]))
if
((
code_seen
(
axis_codes
[
X_AXIS
])
||
code_seen
(
axis_codes
[
Y_AXIS
]))
&&
code_seen
(
axis_codes
[
E_AXIS
]))
gfx_line_to
(
destination
[
X_AXIS
],
destination
[
Y_AXIS
],
destination
[
Z_AXIS
]);
gfx_line_to
(
destination
[
X_AXIS
],
destination
[
Y_AXIS
],
destination
[
Z_AXIS
]);
...
@@ -5615,7 +5636,12 @@ inline void gcode_M221() {
...
@@ -5615,7 +5636,12 @@ inline void gcode_M221() {
inline
void
gcode_M222
()
{
inline
void
gcode_M222
()
{
if
(
setTargetedExtruder
(
222
))
return
;
if
(
setTargetedExtruder
(
222
))
return
;
if
(
code_seen
(
'S'
))
density_multiplier
[
target_extruder
]
=
code_value
();
if
(
code_seen
(
'S'
))
{
density_multiplier
[
target_extruder
]
=
code_value
();
#if ENABLED(RFID_MODULE)
RFID522
.
RfidData
[
target_extruder
].
data
.
density
=
density_multiplier
[
target_extruder
];
#endif
}
}
}
#if ENABLED(COLOR_MIXING_EXTRUDER)
#if ENABLED(COLOR_MIXING_EXTRUDER)
...
@@ -6192,6 +6218,31 @@ inline void gcode_M503() {
...
@@ -6192,6 +6218,31 @@ inline void gcode_M503() {
Config_PrintSettings
(
code_seen
(
'S'
)
&&
code_value
()
==
0
);
Config_PrintSettings
(
code_seen
(
'S'
)
&&
code_value
()
==
0
);
}
}
#if ENABLED(RFID_MODULE)
/**
* M522: Read or Write on card. M522 T<extruders> R<read> or W<write> L<list>
*/
inline
void
gcode_M522
()
{
if
(
setTargetedExtruder
(
522
))
return
;
if
(
!
RFID_ON
)
return
;
if
(
code_seen
(
'R'
))
{
ECHO_LM
(
DB
,
"Put RFID on tag!"
);
Spool_must_read
[
target_extruder
]
=
true
;
}
if
(
code_seen
(
'W'
))
{
if
(
Spool_ID
[
target_extruder
]
!=
0
)
{
ECHO_LM
(
DB
,
"Put RFID on tag!"
);
Spool_must_write
[
target_extruder
]
=
true
;
}
else
ECHO_LM
(
ER
,
"You have not read this Spool!"
);
}
if
(
code_seen
(
'L'
))
RFID522
.
printInfo
(
target_extruder
);
}
#endif // RFID_MODULE
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
/**
/**
...
@@ -7198,7 +7249,7 @@ void process_next_command() {
...
@@ -7198,7 +7249,7 @@ void process_next_command() {
#if ENABLED(COLOR_MIXING_EXTRUDER)
#if ENABLED(COLOR_MIXING_EXTRUDER)
case
223
:
// M223 Set the mix factors for a mixing extruder
case
223
:
// M223 Set the mix factors for a mixing extruder
gcode_M223
;
break
;
gcode_M223
()
;
break
;
#endif
#endif
case
226
:
// M226 P<pin number> S<pin state>- Wait until the specified pin reaches the state required
case
226
:
// M226 P<pin number> S<pin state>- Wait until the specified pin reaches the state required
...
@@ -7302,6 +7353,11 @@ void process_next_command() {
...
@@ -7302,6 +7353,11 @@ void process_next_command() {
case
503
:
// M503 print settings currently in memory
case
503
:
// M503 print settings currently in memory
gcode_M503
();
break
;
gcode_M503
();
break
;
#if ENABLED(RFID_MODULE)
case
522
:
// M422 Read or Write on card. M522 T<extruders> R<read> or W<write>
gcode_M522
();
break
;
#endif
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
case
540
:
case
540
:
gcode_M540
();
break
;
gcode_M540
();
break
;
...
@@ -8053,6 +8109,38 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
...
@@ -8053,6 +8109,38 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
}
}
#endif
#endif
#if ENABLED(RFID_MODULE)
for
(
int8_t
e
=
0
;
e
<
EXTRUDERS
;
e
++
)
{
if
(
Spool_must_read
[
e
])
{
if
(
RFID522
.
getID
(
e
))
{
Spool_ID
[
e
]
=
RFID522
.
RfidDataID
[
e
].
Spool_ID
;
delay
(
200
);
if
(
RFID522
.
readBlock
(
e
))
{
Spool_must_read
[
e
]
=
false
;
density_multiplier
[
e
]
=
RFID522
.
RfidData
[
e
].
data
.
density
;
filament_size
[
e
]
=
RFID522
.
RfidData
[
e
].
data
.
size
;
calculate_volumetric_multipliers
();
RFID522
.
printInfo
(
e
);
}
}
}
if
(
Spool_must_write
[
e
])
{
if
(
RFID522
.
getID
(
e
))
{
if
(
Spool_ID
[
e
]
==
RFID522
.
RfidDataID
[
e
].
Spool_ID
)
{
delay
(
200
);
if
(
RFID522
.
writeBlock
(
e
))
{
Spool_must_write
[
e
]
=
false
;
ECHO_SMV
(
INFO
,
"Spool on E"
,
e
);
ECHO_EM
(
" writed!"
);
RFID522
.
printInfo
(
e
);
}
}
}
}
}
#endif
#if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS)
#if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS)
if
(
IS_SD_INSERTED
&&
!
IS_SD_PRINTING
)
{
if
(
IS_SD_INSERTED
&&
!
IS_SD_PRINTING
)
{
if
(
!
config_readed
)
{
if
(
!
config_readed
)
{
...
...
MK/module/motion/planner.cpp
View file @
9f3e404f
...
@@ -606,8 +606,8 @@ float junction_deviation = 0.1;
...
@@ -606,8 +606,8 @@ float junction_deviation = 0.1;
// For a mixing extruder, get steps for each
// For a mixing extruder, get steps for each
#if ENABLED(COLOR_MIXING_EXTRUDER)
#if ENABLED(COLOR_MIXING_EXTRUDER)
for
(
int8_t
e
=
0
;
e
<
DRIVER_EXTRUDERS
;
e
++
)
for
(
int8_t
i
=
0
;
i
<
DRIVER_EXTRUDERS
;
i
++
)
block
->
mix_steps
[
e
]
=
block
->
steps
[
E_AXIS
]
*
mixing_factor
[
e
];
block
->
mix_steps
[
i
]
=
block
->
steps
[
E_AXIS
]
*
mixing_factor
[
i
];
#endif
#endif
// Add update block variables for LASER BEAM control
// Add update block variables for LASER BEAM control
...
...
MK/module/motion/stepper.cpp
View file @
9f3e404f
...
@@ -580,26 +580,7 @@ void set_stepper_direction(bool onlye) {
...
@@ -580,26 +580,7 @@ void set_stepper_direction(bool onlye) {
}
}
}
}
#if DISABLED(ADVANCE) && ENABLED(DONDOLO)
#if DISABLED(ADVANCE)
if
(
TEST
(
out_bits
,
E_AXIS
))
{
switch
(
active_extruder
)
{
case
0
:
REV_E_DIR
();
break
;
case
1
:
NORM_E_DIR
();
break
;
}
count_direction
[
E_AXIS
]
=
-
1
;
}
else
{
switch
(
active_extruder
)
{
case
0
:
NORM_E_DIR
();
break
;
case
1
:
REV_E_DIR
();
break
;
}
count_direction
[
E_AXIS
]
=
1
;
}
#elif DISABLED(ADVANCE)
if
(
TEST
(
out_bits
,
E_AXIS
))
{
if
(
TEST
(
out_bits
,
E_AXIS
))
{
REV_E_DIR
();
REV_E_DIR
();
count_direction
[
E_AXIS
]
=
-
1
;
count_direction
[
E_AXIS
]
=
-
1
;
...
@@ -671,7 +652,7 @@ ISR(TIMER1_COMPA_vect) {
...
@@ -671,7 +652,7 @@ ISR(TIMER1_COMPA_vect) {
counter_x
=
counter_y
=
counter_z
=
counter_e
=
new_count
;
counter_x
=
counter_y
=
counter_z
=
counter_e
=
new_count
;
#if ENABLED(COLOR_MIXING_EXTRUDER)
#if ENABLED(COLOR_MIXING_EXTRUDER)
for
(
int8_t
e
=
0
;
e
<
DRIVER_EXTRUDERS
;
e
++
)
counter_m
[
e
]
=
new_count
;
for
(
int8_t
i
=
0
;
i
<
DRIVER_EXTRUDERS
;
i
++
)
counter_m
[
i
]
=
new_count
;
#endif
#endif
step_events_completed
=
0
;
step_events_completed
=
0
;
...
@@ -731,7 +712,10 @@ ISR(TIMER1_COMPA_vect) {
...
@@ -731,7 +712,10 @@ ISR(TIMER1_COMPA_vect) {
#define STEP_START(axis, AXIS) \
#define STEP_START(axis, AXIS) \
_COUNTER(axis) += current_block->steps[_AXIS(AXIS)]; \
_COUNTER(axis) += current_block->steps[_AXIS(AXIS)]; \
if (_COUNTER(axis) > 0) { _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS),0); }
if (_COUNTER(axis) > 0) { \
_APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS),0); \
_COUNTER(axis) -= current_block->step_event_count; \
count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; }
STEP_START
(
x
,
X
);
STEP_START
(
x
,
X
);
STEP_START
(
y
,
Y
);
STEP_START
(
y
,
Y
);
...
@@ -739,10 +723,14 @@ ISR(TIMER1_COMPA_vect) {
...
@@ -739,10 +723,14 @@ ISR(TIMER1_COMPA_vect) {
#if DISABLED(ADVANCE)
#if DISABLED(ADVANCE)
#if ENABLED(COLOR_MIXING_EXTRUDER)
#if ENABLED(COLOR_MIXING_EXTRUDER)
counter_e
+=
current_block
->
steps
[
E_AXIS
];
counter_e
+=
current_block
->
steps
[
E_AXIS
];
for
(
uint8_t
j
=
0
;
j
<
DRIVER_EXTRUDERS
;
j
++
)
{
if
(
counter_e
>
0
)
{
for
(
int8_t
j
=
0
;
j
<
DRIVER_EXTRUDERS
;
j
++
)
{
counter_m
[
j
]
+=
current_block
->
mix_steps
[
j
];
counter_m
[
j
]
+=
current_block
->
mix_steps
[
j
];
if
(
counter_m
[
j
]
>
0
)
En_STEP_WRITE
(
j
,
!
INVERT_E_STEP_PIN
);
if
(
counter_m
[
j
]
>
0
)
En_STEP_WRITE
(
j
,
!
INVERT_E_STEP_PIN
);
}
}
counter_e
-=
current_block
->
step_event_count
;
count_position
[
E_AXIS
]
+=
count_direction
[
E_AXIS
];
}
#else
#else
STEP_START
(
e
,
E
);
STEP_START
(
e
,
E
);
#endif
#endif
...
@@ -752,23 +740,13 @@ ISR(TIMER1_COMPA_vect) {
...
@@ -752,23 +740,13 @@ ISR(TIMER1_COMPA_vect) {
delayMicroseconds
(
STEPPER_HIGH_LOW_DELAY
);
delayMicroseconds
(
STEPPER_HIGH_LOW_DELAY
);
#endif
#endif
#define STEP_END(axis, AXIS) \
#define STEP_END(axis, AXIS) _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0)
if (_COUNTER(axis) > 0) { \
_COUNTER(axis) -= current_block->step_event_count; \
count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0); \
}
STEP_END
(
x
,
X
);
STEP_END
(
x
,
X
);
STEP_END
(
y
,
Y
);
STEP_END
(
y
,
Y
);
STEP_END
(
z
,
Z
);
STEP_END
(
z
,
Z
);
#if DISABLED(ADVANCE)
#if DISABLED(ADVANCE)
#if ENABLED(MIXING_EXTRUDER_FEATURE)
#if ENABLED(COLOR_MIXING_EXTRUDER)
// Always count the single E axis
if
(
counter_e
>
0
)
{
counter_e
-=
current_block
->
step_event_count
;
count_position
[
E_AXIS
]
+=
count_direction
[
E_AXIS
];
}
for
(
int8_t
j
=
0
;
j
<
DRIVER_EXTRUDERS
;
j
++
)
{
for
(
int8_t
j
=
0
;
j
<
DRIVER_EXTRUDERS
;
j
++
)
{
if
(
counter_m
[
j
]
>
0
)
{
if
(
counter_m
[
j
]
>
0
)
{
counter_m
[
j
]
-=
current_block
->
step_event_count
;
counter_m
[
j
]
-=
current_block
->
step_event_count
;
...
...
MK/module/motion/stepper.h
View file @
9f3e404f
...
@@ -57,29 +57,43 @@ enum EndstopEnum {X_MIN=0, Y_MIN=1, Z_MIN=2, Z_PROBE=3, X_MAX=4, Y_MAX=5, Z_MAX=
...
@@ -57,29 +57,43 @@ enum EndstopEnum {X_MIN=0, Y_MIN=1, Z_MIN=2, Z_PROBE=3, X_MAX=4, Y_MAX=5, Z_MAX=
#define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); }
#define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); }
#define REV_E_DIR() { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); }
#define REV_E_DIR() { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); }
#endif
#endif
#elif DRIVER_EXTRUDERS > 5
#define E_STEP_WRITE(v) { switch(current_block->active_driver) { case 5: E5_STEP_WRITE(v); break; case 4: E4_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 0: E0_STEP_WRITE(v); break; } }
#define NORM_E_DIR() { switch(current_block->active_driver) { case 5: E5_DIR_WRITE(!INVERT_E5_DIR); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; } }
#define REV_E_DIR() { switch(current_block->active_driver) { case 5: E5_DIR_WRITE( INVERT_E5_DIR); break; case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; } }
#elif DRIVER_EXTRUDERS > 4
#define E_STEP_WRITE(v) { switch(current_block->active_driver) { case 4: E4_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 0: E0_STEP_WRITE(v); break; } }
#define NORM_E_DIR() { switch(current_block->active_driver) { case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; } }
#define REV_E_DIR() { switch(current_block->active_driver) { case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; } }
#elif DRIVER_EXTRUDERS > 3
#elif DRIVER_EXTRUDERS > 3
#define E_STEP_WRITE(v) {
if(current_block->active_driver == 3) { E3_STEP_WRITE(v); } else { if(current_block->active_driver == 2) { E2_STEP_WRITE(v); } else { if(current_block->active_driver == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}}
}
#define E_STEP_WRITE(v) {
switch(current_block->active_driver) { case 3: E3_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 0: E0_STEP_WRITE(v); break; }
}
#define NORM_E_DIR()
{ if(current_block->active_driver == 3) { E3_DIR_WRITE( !INVERT_E3_DIR); } else { if(current_block->active_driver == 2) { E2_DIR_WRITE(!INVERT_E2_DIR); } else { if(current_block->active_driver == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}}
}
#define NORM_E_DIR()
{ switch(current_block->active_driver) { case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; }
}
#define REV_E_DIR()
{ if(current_block->active_driver == 3) { E3_DIR_WRITE(INVERT_E3_DIR); } else { if(current_block->active_driver == 2) { E2_DIR_WRITE(INVERT_E2_DIR); } else { if(current_block->active_driver == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }}}
}
#define REV_E_DIR()
{ switch(current_block->active_driver) { case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; }
}
#elif DRIVER_EXTRUDERS > 2
#elif DRIVER_EXTRUDERS > 2
#define E_STEP_WRITE(v) {
if(current_block->active_driver == 2) { E2_STEP_WRITE(v); } else { if(current_block->active_driver == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}
}
#define E_STEP_WRITE(v) {
switch(current_block->active_driver) { case 2: E2_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 0: E0_STEP_WRITE(v); break; }
}
#define NORM_E_DIR()
{ if(current_block->active_driver == 2) { E2_DIR_WRITE(!INVERT_E2_DIR); } else { if(current_block->active_driver == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}
}
#define NORM_E_DIR()
{ switch(current_block->active_driver) { case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; }
}
#define REV_E_DIR()
{ if(current_block->active_driver == 2) { E2_DIR_WRITE(INVERT_E2_DIR); } else { if(current_block->active_driver == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }}
}
#define REV_E_DIR()
{ switch(current_block->active_driver) { case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; }
}
#elif DRIVER_EXTRUDERS > 1
#elif DRIVER_EXTRUDERS > 1
#if DISABLED(DUAL_X_CARRIAGE)
#if DISABLED(DUAL_X_CARRIAGE)
#define E_STEP_WRITE(v) {
if(current_block->active_driver == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v)
; }}
#define E_STEP_WRITE(v) {
switch(current_block->active_driver) { case 1: E1_STEP_WRITE(v); break; case 0: E0_STEP_WRITE(v); break
; }}
#define NORM_E_DIR()
{ if(current_block->active_driver == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR)
; }}
#define NORM_E_DIR()
{ switch(current_block->active_driver) { case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break
; }}
#define REV_E_DIR()
{ if(current_block->active_driver == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR)
; }}
#define REV_E_DIR()
{ switch(current_block->active_driver) { case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 0: E0_DIR_WRITE( INVERT_E0_DIR); break
; }}
#else
#else
extern
bool
extruder_duplication_enabled
;
extern
bool
extruder_duplication_enabled
;
#define E_STEP_WRITE(v) { if(extruder_duplication_enabled) { E0_STEP_WRITE(v); E1_STEP_WRITE(v); } else if(current_block->active_driver == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}
#define E_STEP_WRITE(v) { if(extruder_duplication_enabled) { E0_STEP_WRITE(v); E1_STEP_WRITE(v); } else if(current_block->active_driver == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}
#define NORM_E_DIR() { if(extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else if(current_block->active_driver == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}
#define NORM_E_DIR() { if(extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else if(current_block->active_driver == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}
#define REV_E_DIR()
{ if(extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if(current_block->active_driver == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(
INVERT_E0_DIR); }}
#define REV_E_DIR()
{ if(extruder_duplication_enabled) { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); } else if(current_block->active_driver == 1) { E1_DIR_WRITE( INVERT_E1_DIR); } else { E0_DIR_WRITE(
INVERT_E0_DIR); }}
#endif
#endif
#else
#else
#if ENABLED(DONDOLO)
#define E_STEP_WRITE(v) E0_STEP_WRITE(v)
#define NORM_E_DIR() { switch(active_extruder) { case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; }}
#define REV_E_DIR() { switch(active_extruder) { case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; }}
#else
#define E_STEP_WRITE(v) E0_STEP_WRITE(v)
#define E_STEP_WRITE(v) E0_STEP_WRITE(v)
#define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR)
#define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR)
#define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR)
#define REV_E_DIR() E0_DIR_WRITE( INVERT_E0_DIR)
#endif
#endif //DRIVER_EXTRUDERS
#endif //DRIVER_EXTRUDERS
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment