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

Use deploy/stow with FIX_MOUNTED_PROBE too #4100

Merged
merged 8 commits into from
Jun 21, 2016

Conversation

thinkyhead
Copy link
Member

Follow up #4096

  • Define deploy_z_probe and stow_z_probe even without ABL

thinkyhead referenced this pull request Jun 20, 2016
Always raise Z (if needed) for servo deploy/stow
@MagoKimbra
Copy link
Contributor

Hello Scott.
A question, these are checks of defined constants:

if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE)
   feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
if (Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X)
  destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X;
if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y)
  destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y;
destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z;

it is not best to do so?

#if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE)
   feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
#endif
#if (Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X)
  destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X;
#endif
#if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y)
  destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y;
#endif
destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z;

@thinkyhead
Copy link
Member Author

thinkyhead commented Jun 20, 2016

it is not best to do so?

Perhaps. But the result here will be the same. If the compiler sees if (12 != 12) printf("Hi there!"); which will never succeed, it won't compile any code for that line.

@MagoKimbra
Copy link
Contributor

I admit my ignorance, but I thought I compile the same code by adding useless. How not say sorry ..

@thinkyhead thinkyhead force-pushed the rc_z_deploy branch 2 times, most recently from f8640ad to e93b687 Compare June 20, 2016 22:02
@thinkyhead
Copy link
Member Author

thinkyhead commented Jun 20, 2016

The current code will throw an error if any of these allen key macros are undefined. Using preprocessor macros, we need to do a little more work, because undefined macros are evaluated as zero. So really, you would need:

#if defined(Z_PROBE_ALLEN_KEY_STOW_2_X) && defined(Z_PROBE_ALLEN_KEY_STOW_1_X) \
  && Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X
  destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X;
#endif

@thinkyhead thinkyhead force-pushed the rc_z_deploy branch 2 times, most recently from bcb5ee0 to 915b96e Compare June 20, 2016 23:25
@thinkyhead thinkyhead merged commit 71534dc into MarlinFirmware:RCBugFix Jun 21, 2016
@thinkyhead thinkyhead deleted the rc_z_deploy branch June 21, 2016 07:40
@thinkyhead thinkyhead mentioned this pull request Jul 8, 2016
@jbrazio jbrazio modified the milestone: 1.1.0 Jul 18, 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.

3 participants