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

added option to prevent machine lock after program end #785

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions uCNC/cnc_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ extern "C"
#define ENABLE_O_CODES_VERBOSE
#endif

/**
* Uncomment to prevent machine lock after end program (M2 or M30)
*/
// #define DISABLE_ENDPROGRAM_LOCK

/**
* Shrink µCNC
* It's possible to shrink µCNC by disable some core features:
Expand Down
6 changes: 4 additions & 2 deletions uCNC/src/core/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,9 @@ static uint8_t parser_grbl_exec_code(uint8_t code)
#endif
#ifdef ENABLE_RS274NGC_EXPRESSIONS
case GRBL_PRINT_PARAM:
if (parser_get_float(&value) == NUMBER_OK
if (parser_get_float(&value) == NUMBER_OK
#ifdef ENABLE_NAMED_PARAMETERS
|| parser_get_namedparam_id(&value) == NUMBER_OK
|| parser_get_namedparam_id(&value) == NUMBER_OK
#endif
)
{
Expand Down Expand Up @@ -1973,8 +1973,10 @@ static uint8_t parser_exec_command(parser_state_t *new_state, parser_words_t *wo
break;
case 3: // M2
case 4: // M30 (pallet change has no effect)
#ifndef DISABLE_ENDPROGRAM_LOCK
hold = true;
resetparser = true;
#endif
break;
}

Expand Down
Loading