Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend M421 with I and J parameters #3798

Merged
merged 1 commit into from
May 20, 2016

Conversation

AnHardt
Copy link
Member

@AnHardt AnHardt commented May 19, 2016

Extend M421 with I and J parameters to access its mesh-points directly.

@jbrazio jbrazio added this to the 1.1.0 milestone May 19, 2016
if ((hasZ = code_seen('Z'))) z = code_value();

if (hasX && hasY && hasZ) {

int8_t ix = mbl.select_x_index(x),
iy = mbl.select_y_index(y);

if (ix >= 0 && iy >= 0)
if (ix >= 0 && ix < MESH_NUM_X_POINTS && iy >= 0 && iy < MESH_NUM_Y_POINTS)
Copy link
Member

@thinkyhead thinkyhead May 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select_x_index and select_y_index can never return values >= to MESH_NUM_X_POINTS or MESH_NUM_Y_POINTS. If a point is too far out of range, these functions return a -1.

@AnHardt
Copy link
Member Author

AnHardt commented May 20, 2016

Updated.

@@ -5899,12 +5899,16 @@ inline void gcode_M410() { stepper.quick_stop(); }

/**
* M421: Set a single Mesh Bed Leveling Z coordinate
* Eter with 'M421 Xmm Ymm Zmm' or with 'M421 In Jm Zmm'
Copy link
Member

@thinkyhead thinkyhead May 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor misspelling. And the word "with" isn't used quite this way in formal English. Better phrasing:

* Use either 'M421 X<mm> Y<mm> Z<mm>' or 'M421 I<xindex> J<yindex> Z<mm>'

To keep "Enter … with" you could say:

* Enter 'M421' with 'X<mm> Y<mm> Z<mm>' or with 'I<xindex> J<yindex> Z<mm>'

Sorry to be so pedantic. I don't mind merging this and just fixing it up later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Extend M421 with I and J parameters
@thinkyhead thinkyhead merged commit cadf441 into MarlinFirmware:RCBugFix May 20, 2016
@AnHardt AnHardt deleted the extend-M421 branch May 21, 2016 02:58
@thinkyhead thinkyhead mentioned this pull request Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants