software_endstops: use *_MIN_POS and *_MAX_POS for arcs

If [XYZ]_HOME_POS and [XYZ]_MIN_POS aren't 0, these corrections are
wrong.  Use the same logic as in Marlin.pde:prepare_move: ie, clamp to
[XYZ]_{MIN,MAX}_POS.

While we're here, put this cut-and-paste code in a function
clamp_to_software_endstops.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
This commit is contained in:
Ian Jackson
2012-08-09 18:15:32 +01:00
parent 3f15b7c7b8
commit faccb35850
3 changed files with 15 additions and 18 deletions

View File

@ -169,6 +169,7 @@ bool IsStopped();
void enquecommand(const char *cmd); //put an ascii command at the end of the current buffer.
void prepare_arc_move(char isclockwise);
void clamp_to_software_endstops(float target[3]);
#ifdef FAST_PWM_FAN
void setPwmFrequency(uint8_t pin, int val);