diff --git a/changelog.md b/changelog.md index dc45c8b..658d45f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,23 @@ ## grblHAL changelog +Build 20240427 + +Core: + +* Added config to enable NGC parameter reporting, default on. + +Drivers: + +* STM32F1xx: disabled NGC parameter reporting in order free up some flash space \(for 128K variants\). + +Plugins: + +* SD card (file system macros): added inbuilt `G65P2QR` macro for reading tool offset from tool table. `` is tool number, `` is axis number: 0 = X, 1 = Y, ... + +* Keypad: allow MPG to take control when estop state is active. + +--- + Build 20240425 Core: @@ -8,13 +26,11 @@ Core: Drivers: -STM32F1xx: - -* Fix for broken handling of control signals for RC variant processors. Ref. issue [#51](https://github.com/grblHAL/STM32F1xx/issues/51) and discussion [#499](https://github.com/grblHAL/core/discussions/499). +* STM32F1xx: fix for broken handling of control signals for RC variant processors. Ref. issue [#51](https://github.com/grblHAL/STM32F1xx/issues/51) and discussion [#499](https://github.com/grblHAL/core/discussions/499). Plugins: -* File system macros: added inbuilt `G65P1Q` macro for reading numeric setting value. `` is setting number. Ref. issue [#493](https://github.com/grblHAL/core/issues/493). +* SD card (file system macros): added inbuilt `G65P1Q` macro for reading numeric setting value. `` is setting number. Ref. issue [#493](https://github.com/grblHAL/core/issues/493). --- diff --git a/config.h b/config.h index 5b5a2a4..74596fa 100644 --- a/config.h +++ b/config.h @@ -513,7 +513,7 @@ Number of tools in tool table, edit to enable (max. 32 allowed) /*! \def NGC_EXPRESSIONS_ENABLE \brief -Set to \ref On or 1 to enable experimental support for parameters and expressions. +Set to \ref On or 1 to enable experimental support for expressions. Some LinuxCNC extensions are supported, conditionals and subroutines are not. */ @@ -521,6 +521,14 @@ Some LinuxCNC extensions are supported, conditionals and subroutines are not. #define NGC_EXPRESSIONS_ENABLE Off #endif +/*! \def NGC_PARAMETERS_ENABLE +\brief +Set to \ref On or 1 to enable experimental support for parameters. +*/ +#if !defined NGC_PARAMETERS_ENABLE || defined __DOXYGEN__ +#define NGC_PARAMETERS_ENABLE On +#endif + /*! \def NGC_N_ASSIGN_PARAMETERS_PER_BLOCK \brief Maximum number of parameters allowed in a block. @@ -1953,6 +1961,11 @@ __NOTE:__ Must be a positive values. #define N_SYS_SPINDLE 8 #endif +#if NGC_EXPRESSIONS_ENABLE && !NGC_PARAMETERS_ENABLE +#undef NGC_PARAMETERS_ENABLE +#define NGC_PARAMETERS_ENABLE On +#endif + #if (REPORT_WCO_REFRESH_BUSY_COUNT < REPORT_WCO_REFRESH_IDLE_COUNT) #error "WCO busy refresh is less than idle refresh." #endif diff --git a/gcode.c b/gcode.c index 9179ba7..2091f0d 100644 --- a/gcode.c +++ b/gcode.c @@ -3355,8 +3355,10 @@ status_code_t gc_execute_block (char *block) case NonModal_MacroCall: { +#if NGC_PARAMETERS_ENABLE ngc_named_param_set("_value", 0.0f); ngc_named_param_set("_value_returned", 0.0f); +#endif status_code_t status = grbl.on_macro_execute((macro_id_t)gc_block.values.p); return status == Status_Unhandled ? Status_GcodeValueOutOfRange : status; diff --git a/grbl.h b/grbl.h index 0d32a04..f46117c 100644 --- a/grbl.h +++ b/grbl.h @@ -42,7 +42,7 @@ #else #define GRBL_VERSION "1.1f" #endif -#define GRBL_BUILD 20240425 +#define GRBL_BUILD 20240427 #define GRBL_URL "https://github.com/grblHAL" diff --git a/ngc_params.c b/ngc_params.c index 282a93f..093c6bb 100644 --- a/ngc_params.c +++ b/ngc_params.c @@ -24,6 +24,10 @@ Most additional predefined parameters defined by LinuxCNC (ref section 5.2.3.1) are implemented. */ +#include "hal.h" + +#if NGC_PARAMETERS_ENABLE + #include #include #include @@ -655,3 +659,5 @@ bool ngc_named_param_set (char *name, float value) return ok; } + +#endif // NGC_PARAMETERS_ENABLE diff --git a/report.c b/report.c index c5fc56f..a6528c2 100644 --- a/report.c +++ b/report.c @@ -542,6 +542,8 @@ void report_tool_offsets (void) hal.stream.write("]" ASCII_EOL); } +#if NGC_PARAMETERS_ENABLE + // Prints NIST/LinuxCNC NGC parameter value status_code_t report_ngc_parameter (ngc_param_id_t id) { @@ -576,6 +578,7 @@ status_code_t report_named_ngc_parameter (char *arg) return Status_OK; } +#endif // Prints Grbl NGC parameters (coordinate offsets, probing, tool table) void report_ngc_parameters (void) diff --git a/report.h b/report.h index 17ef1cf..b5b1b3a 100644 --- a/report.h +++ b/report.h @@ -70,12 +70,16 @@ void report_probe_parameters (void); // Prints current tool offsets. void report_tool_offsets (void); +#if NGC_PARAMETERS_ENABLE + // Prints NIST/LinuxCNC NGC parameter value status_code_t report_ngc_parameter (ngc_param_id_t id); // Prints named LinuxCNC NGC parameter value status_code_t report_named_ngc_parameter (char *arg); +#endif + // Prints Grbl NGC parameters (coordinate offsets, probe). void report_ngc_parameters (void); diff --git a/system.c b/system.c index d56e13e..ff2db49 100644 --- a/system.c +++ b/system.c @@ -558,12 +558,16 @@ static status_code_t output_ngc_parameters (sys_state_t state, char *args) status_code_t retval = Status_OK; if(args) { +#if NGC_PARAMETERS_ENABLE int32_t id; retval = read_int(args, &id); if(retval == Status_OK && id >= 0) retval = report_ngc_parameter((ngc_param_id_t)id); else retval = report_named_ngc_parameter(args); +#else + retval = Status_InvalidStatement; +#endif } else report_ngc_parameters(); @@ -831,7 +835,9 @@ PROGMEM static const sys_command_t sys_commands[] = { { "J", jog, {}, { .str = "$J= - jog machine" } }, { "#", output_ngc_parameters, { .allow_blocking = On }, { .str = "output offsets, tool table, probing and home position" +#if NGC_PARAMETERS_ENABLE ASCII_EOL "$#= - output value for parameter " +#endif } }, { "$", output_settings, { .allow_blocking = On }, { .str = "$ - output setting value"