Skip to content

Commit

Permalink
tool_change.cpp reads angles from servo_angles instead of SWITCHING_N…
Browse files Browse the repository at this point in the history
…OZZLE_SERVO_ANGLES
  • Loading branch information
rubienr committed Sep 23, 2023
1 parent 896a196 commit 4ff4b4e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
19 changes: 13 additions & 6 deletions Marlin/src/module/servo.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,19 @@
#define Z_PROBE_SERVO_NR -1
#endif
#define ASRC(N,I) ( \
N == SWITCHING_EXTRUDER_SERVO_NR ? sase[I] \
: N == SWITCHING_EXTRUDER_E23_SERVO_NR ? sase[I+2] \
: N == SWITCHING_NOZZLE_SERVO_NR ? sasn[N][I] \
: N == Z_PROBE_SERVO_NR ? sazp[I] \
: 0 )
#if ENABLED(SWITCHING_NOZZLE_TWO_SERVOS)
#define SWITCHING_NOZZLE_E1_SERVO_ANGLE(N, I) : N == SWITCHING_NOZZLE_E1_SERVO_NR ? sasn[1][I]
#else
#define SWITCHING_NOZZLE_E1_SERVO_ANGLE(N, I)
#endif
#define ASRC(N,I) ( \
N == SWITCHING_EXTRUDER_SERVO_NR ? sase[I] \
: N == SWITCHING_EXTRUDER_E23_SERVO_NR ? sase[I+2] \
: N == SWITCHING_NOZZLE_SERVO_NR ? sasn[0][I] \
SWITCHING_NOZZLE_E1_SERVO_ANGLE(N, I) \
: N == Z_PROBE_SERVO_NR ? sazp[I] \
: 0 )
#if ENABLED(EDITABLE_SERVO_ANGLES)
extern uint16_t servo_angles[NUM_SERVOS][2];
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/module/tool_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,8 @@

inline void _move_nozzle_servo(const uint8_t e, const uint8_t angle_index) {
constexpr int8_t sns_index[2] = { SWITCHING_NOZZLE_SERVO_NR, SWITCHING_NOZZLE_E1_SERVO_NR };
constexpr int16_t sns_angles[][2] = SWITCHING_NOZZLE_SERVO_ANGLES;
planner.synchronize();
servo[sns_index[e]].move(sns_angles[e][angle_index]);
servo[sns_index[e]].move(servo_angles[sns_index[e]][angle_index]);
safe_delay(SWITCHING_NOZZLE_SERVO_DWELL);
}

Expand Down

0 comments on commit 4ff4b4e

Please sign in to comment.