Skip to content

Commit

Permalink
Merge pull request #785 from Paciente8159/prevent-endprogram-lock-option
Browse files Browse the repository at this point in the history
added option to prevent machine lock after program end
  • Loading branch information
Paciente8159 authored Nov 21, 2024
2 parents 3c88a95 + 09d8344 commit 9adf983
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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

0 comments on commit 9adf983

Please sign in to comment.