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

Add Menu Items to initiate M303 #3202

Merged
merged 3 commits into from Mar 24, 2016

Conversation

thinkyhead
Copy link
Member

This is a patch on top of the earlier PR #3189 by @WPBack. This PR adds onto the original by making the Autotune items into edit items so a target temperature can be selected. When the click-wheel is pressed, the selected value will be used as the "S" parameter to M303.

Additional changes were needed.

  • Added an array to store the temperatures being edited in the menus. As with M303 they default to 150. (Perhaps they would all be better to default to EXTRUDE_MINTEMP, but that's another topic.)
  • Added a const array to store the heater max temps so that these values can be picked up by the macro. (This is necessary because the pre-processor cannot recurse. I.e., you cannot compose a macro name from substitution parts [like the e here in HEATER_## e ##_MAXTEMP] and then get the value of that macro – it's just too "meta"). A const array gets around this limitation.
  • The U parameter is now documented in the comment to gcode_M303 and takes any non-zero value as "true".
  • Opened up the option to add bed PID and autotune options as well. The functions are ready if menu items should be added.
  • The function enqueue_and_echo_command_now was added as a way to always enqueue a command now, only returning to the caller once the command is enqueued, whereas the function enqueue_and_echo_command may return immediately without success. The new function was applied to a point in cardreader.cpp where enqueue_and_echo_command might (extremely rarely) cause a failure to enqueue the M23 command.
  • Renamed the COPY_AND_SCALE internal macro to the more appropriate _PIDTEMP_FUNCTIONS since it now defines more menu functions.

@thinkyhead thinkyhead force-pushed the rc_menu_item_M303_redo branch 2 times, most recently from 4c33f0f to b37cf9b Compare March 22, 2016 02:10
@thinkyhead thinkyhead force-pushed the rc_menu_item_M303_redo branch 4 times, most recently from 5ebdf53 to 89cb72c Compare March 22, 2016 03:55
@Blue-Marlin
Copy link
Contributor

Wow. That menu was even more complex than i supposed it to be. Congratulations.

@thinkyhead
Copy link
Member Author

These edit-and-callback items can be tricky!

Adds the parameter U to M303. If U1 is included , it will use the
PID-values from the auto-tune.
Fixes for MarlinFirmware#3189

Setting a temp is still missing
@thinkyhead thinkyhead merged commit 02f466e into MarlinFirmware:RCBugFix Mar 24, 2016
@thinkyhead thinkyhead deleted the rc_menu_item_M303_redo branch March 24, 2016 14:40
@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.

None yet

4 participants