16 Commits

Author SHA1 Message Date
Terje Io
c6aa574279 Added experimental support for M98 subroutines, internal subroutines are only supported for programs run from a local file system.
$700 controls whether they are scanned for internally in the main program (1) or always located externally (0).
If scanned for internally the program is run twice, initially in check mode to locate the subroutines before it is rewound and run in normal mode.
If stored externally the file P<macro number>.macro is run, <macro number> is the M98 P value.
2026-02-02 22:25:31 +01:00
Terje Io
b80cd2f3f8 Changed error code reported when file not found for G65 macro or named O-sub calls from 39 to 84.
Removed IDLE state requirement for executing G65 macros, an error will no longer be returned and the macro will be run.
Added event handler for outputting welcome message on "native" USB connect for drivers that provides the linestate changed event.
2025-01-05 08:18:52 +01:00
Terje Io
2952a3eeb9 Added directory (mounts) listing capabilities to the default root file system when no real root file system (SD card) is mounted. 2024-12-19 11:34:11 +01:00
Terje Io
0b8bce16c6 Added support for named o-sub/o-call to flow control, for calling gcode subroutines stored on SD card or in littlefs.
Sub name matches filename with extension .macro.
Added core event for handling special gcode comments used by expressions and flow control: DEBUG, PRINT and ABORT.
Added overrideable default $-setting values for second PWM spindle to grbl/config.c.
2024-11-16 22:02:00 +01:00
Terje Io
9a98243fd3 Changed _vminor named parameter to contain build date in YYMMDD format, previously value was 0.
Added support for LinuxCNC style (ABORT,<msg>) comment, requires expressions enabled. Terminates gcode program, outputs message and returns error 253.
Added PRM[<setting>] and PRM[<setting>,<bit>] functions to expressions, returns $-setting value or value of bit in integer type setting.
"hardened" flow control code, fixed bug in repeat...continue handling.
Changed signature of grbl.on_gcode_comment event, now returns status code.
2024-10-27 07:27:25 +07:00
Terje Io
ee8eb2c1eb Fixed some odd bugs in NGC flow control, prepared for file based named O-call subroutines.
Fixed incorrect comment string passed to passed to grbl.on_gcode_comment event.
Added generic redirector for temporarily changing input stream to read from a file. Supports nesting.
2024-10-23 20:18:34 +07:00
Terje Io
f0eac9d0aa Improved expression and parameter handling, simplified gcode parser related to this. Fixed typo in OR statement decode.
Added clear of return value on CALL statement and added optional return value expression support to ENDSUB.
Improved handling of multiple simultaneous spindles. Still work in progress.
For developers: moved user M-code entry point hooks from the HAL structure to the core handlers and changed signature of the check() function to better support valueless words (letters) when parameter support is enabled. Removed deprecated parameter from the validate() call signature.
2024-10-14 19:02:30 +07:00
Terje Io
323dd84b79 Added (PRINT, <msg>) support and parameter formatting for DEBUG and PRINT commands.
Added named parameters for getting absolute (G53) position: _abs_x, abs_y, ...
Available when expression support is enabled.

Changed stepper enable HAL signature to allow current reduction when idle.
Added reference id to spindle registration in order to allow configuring default spindle, and possibly additional spindles, at compile time.
2024-09-29 12:38:49 +07:00
Terje Io
9a060d7ea0 Renamed grbl.on_probe_fixture event to grbl.on_probe_toolsetter and added pointer to toolsetter coordinates as an additional parameter.
Increased backlash parameters precision to 5 decimals. Ref issue #452.
Some bug fixes in NGC parameters and flow control handling.
2024-06-19 20:37:30 +02:00
Terje Io
299eab7f27 Added experimental support for M70-M73, save and restore of modal state.
Added experimental support of LinuxCNC style subroutines.
Available for gcode run from local filesystem such as on a SD card or in littlefs.
Improved handling of G92 when G92 offset is changed while motion is ongoing. Ref. issue #241.
Fix for issue #521, crash when running G65 macro on ESP32.
"Hardened" stream switching code, likely fix for discussion #456.
2024-05-26 17:12:08 +07:00
Terje Io
fed76cf596 Fix for incorrect handling of some flow control statements when nested. Ref. issue #504.
Fixed defaults and added sanity checks for spindle linearization parameters settings.
2024-05-06 12:00:01 +02:00
Terje Io
69f91b1952 Fix for bug in NGC expressions return statement handling. Ref issue #485. 2024-04-08 16:19:50 +02:00
Terje Io
c886caedbf Fixed bug in WHILE loop handling when first statement in macro. 2023-07-24 10:30:56 +02:00
Terje Io
0c6f3f6dd7 Added support for traversing directory structure across file system mounts. Allows access to littlefs mount via ftp.
Fixed inconsistent (random) real-time reporting of cycle start signal by adding a latch to ensure it is reported at least once.
2023-07-16 13:03:22 +02:00
Terje Io
d67d9c86e6 Improved experimental support for program flow control. 2023-06-02 10:10:55 +02:00
Terje Io
ce7c3592b4 Added experimental support for program flow control, mainly available for use in G65 macros stored on SD card or in littlefs. 2023-05-29 00:46:05 +02:00