23 Commits

Author SHA1 Message Date
Terje Io
8c3d44bfca Added helper code for plugins claiming auxiliary ports to make plugin coding easier and behaviour consistent.
Some minor bug fixes such as incorrect error code returned for unknown $-commands and temporary incorrect position reporting on in-flight G92 offset changes.
2025-10-11 18:28:21 +02:00
Terje Io
02b45f86e5 Fix for corrupted tool table entries not beeing reset. This may happen on resizing the tool table.
Added system parameter _tool_table_size, 0 if a tool table is not enabled.
Removed dependency on safety door input for parking settings: $41, $42, $56-$59, $392 and $393.
Removed strict dependency on spindle encoder input for spindle synced motion,
allows the use of the stepper spindle which has an implicit encoder.
2025-07-31 08:19:07 +02:00
Terje Io
74eb456533 Added ioports API call for remapping port numbers.
Added HAL support for setting serial stream format.
Added setting $681 for configuring Modbus RTU stream parity, available when the underlying driver supports format setting.
2025-07-05 14:17:11 +02:00
Terje Io
ae006ebafe missed commit 2025-04-13 21:23:24 +02:00
Terje Io
e1ea957ca4 Added wrappers/veneers for hal.port functions, plugin code should be changed to use
these instead of calling via hal.port functions or accessing hal.port properties.
Improved the ioports API, updated core code to make use of it.
Flagged some calls and (part of) some stuctures as deprecated.
2025-04-13 20:54:09 +02:00
Terje Io
790cff7036 Increased max number of digital ioports to 24, added some crossbar capabilities (external, async, entry point for setting pin function). 2025-04-07 19:36:50 +02:00
Terje Io
bbd3b69939 Added new mid/low level HAL/API to ioports (auxiliary ports).
Added '$709' setting for second PWM spindle when available - PWM options.
Added properties to PWM spindles to allow "overdriving" PWM output when _RPM controls spindle enable signal is enabled with '$9' or '$709'.
Optimized Modbus CRC calculation, may fix issue with a compiler generating different code compared to most others. Ref. issue #723.
2025-04-05 17:20:44 +02:00
Terje Io
8e2847a6c6 Some ioports HAL wrapper functions refactored. Fixes persisting issue with coprocessor control pins mentioned here.
Changed some parts to no longer reference deprecated code.
Added some display driver symbols (for plugin use).
2025-03-11 19:18:08 +01:00
Terje Io
472012e137 Changed $65 setting to flags for allowing feed rate overrides during probing and limiting probe motion to be within machine workspace.
Improved handling of stop realtime command (0x19) for faster motion halt without losing position.
Optimized RAM usage. Fixed regression related to losing current coordinate system and tool offset over a stop.
2025-02-20 10:46:04 +01:00
Terje Io
efe4245a06 "hardened" task deregistration code and changed signature of setting available and ioport_find_free() calls.
Some low-level ioport improvements, added definition for virtual pins/ports.
Deprecated direct access to number of the different ioport ports in hal.port struct, use ioports_unclaimed() instead.
2025-01-14 17:13:56 +01:00
Terje Io
22a8a08a95 Fixed inconsistent handling of auxiliary port numbers when claiming from plugins.
New API call added related to this.
2025-01-09 12:17:25 +01:00
Terje Io
7cf86877f0 Changed signature of grbl.on_homing complete event to include the cycle flags.
Added definitions for up to four additional digital aux I/O ports.
Added real time report of selected spindle in multi spindle configurations. Reported on changes only.
Removed limits override input invert config, for safety reasons it is always active low.
Added HAL entry points for second RGB channel, renamed first from hal.rgb to hal.rgb0.
Added option to setting $22 to force use of limit switches for homing when homing inputs are available in the driver/board combo.
Improved handling of aux I/O pins when claimed for core functions.
Added flag to $9 for disabling laser mode capability for primary PWM spindle. Allows leaving laser mode enabled when a secondary PWM spindle is available and this is used to control a laser.
Added some generic setting definitions for stepper drivers, currently used by the motors plugin.
2024-03-19 20:32:40 +01:00
Terje Io
06f442643a Tentative fix for lathe CSS/feed per rev modes (G96/G95), ref discussion #450.
Fixed incorrect reporting of feed rate modes in $G response.
Added some ioPorts call wrappers, full support for reconfiguring output auxillary pins for PWM output.
2024-02-28 17:36:17 +01:00
Terje Io
a912ce47c7 This build has moved the probe input to the ioPorts pool of inputs and will be allocated from it when configured.
The change is major and potentially dangerous, it may damage your probe, so please verify correct operation after installing.

Fix for STM32F4xx issue 161, Ethernet connection unresponsive if USB port not powered.

Enhanced ioPorts interface: New debounce option for input pins that are interrupt capable, currently only possible to enable via plugin code - later to be made available via a $-setting.
Added some wrapper functions for simpler plugin code++

Added simple task scheduler to the core, allows interrupt routines to dispatch jobs to the foreground process, delayed tasks and repeating tasks attached to the 1 ms system timer.
Some drivers and plugins now uses the scheduler for input pin debouncing, regular polling etc. The core uses it for stepper disabling and sleep monitoring.
2024-02-23 22:54:00 +01:00
Terje Io
f0ef77435e Enhanced RGB and ioports APIs.
Allowed use of unused (by the core) axis words (ABCUVW) in M-code commands implemented by plugin code.
Added $PINSTATE command, for outputting auxillary pin states, modes and capabilities. Machine readable formatting.
2024-01-24 18:38:08 +01:00
Terje Io
cf98ec7778 Added RGB API to the HAL, with crossbar definitions for number of devices (LEDs, NeoPixels).
Refactored some inconsistent parts of the ioports/crossbar interfaces.
2024-01-19 17:43:07 +01:00
Terje Io
6afe6d1a7c Fix for issue #426, decreasing the $30 setting value (max spindle RPM) causes incorrect PWM output.
Implemented handling of single block, block delete and optional stop disable control signal events.
Added help for $S (single block), $B (block delete) and $O (optional stop disable) commands.
Added optional HAL entry point for outputting WRGB values to lights such as neopixels.
Improved $-commands registration to make it easier to add help text.
2024-01-12 13:49:36 +01:00
Terje Io
2c58f0de09 Spindle handling refactoring for improved management and configuration of multiple spindles.
NOTE: this is a relatively large change and may have introduced bugs and/or unintended side-effects. Please report any issues!

Added setting $519 for binding spindle encoder to given spindle in multi spindle configurations.

Added machine readable spindle enumeration report, $SPINDLESH.

Increased default value for setting $398 (number of planner blocs) from 35 to 100 for faster laser engraving.
NOTE: the $398 setting value will not change on an upgrade!
NOTE: STM32F103 builds for the 128K flash variants does not have enough free RAM and will keep 35 as the default value.

Increased allowed number of decimal places from 3 to 5 for $10x stepper step/mm settings. Ref. ioSender issue 346.

Added setting $650 for filing system options. Ref. issue 397.
Currently the following bits are available (depending on the configuration):
0 - Auto mount SD card on startup (1).
1 - Do not add littlefs files when listing the root directory (2).

Added build option for lathe UVW mode.
When enabled UVW words can be used to command relative moves for XYZ without switching to relative mode with G91.
NOTE: This permanently sets lathe mode and disables the $32 mode setting.

There are signature changes to some spindle, ioports enumeration and VFS filing system mount functions.

Added events to allow plugin code to handle tool table data, possibly stored on a SD card.
2023-12-12 09:51:59 +01:00
Terje Io
5f03578e92 Expanded ioports API with generalized settings handling++ 2023-05-27 09:06:07 +02:00
Terje Io
5249bc66fa Expanded ioports API with some configuration and PWM related functions. 2023-05-25 08:57:10 +02:00
Terje Io
fb60b493b5 Added settings, updated settings version to 22. See changelog for details.
Merged defaults.h with config.h, deleted defaults.h and harmonized settings defines.
2023-01-25 21:11:21 +01:00
luz paz
90fd6ca410 Fix various typos
Found via`codespell -q 3 -L iterm,nd`
2022-08-07 18:56:52 -04:00
Terje Io
0c47a688b5 Enhanced ioports API, fix for issue #87 ++ 2021-11-17 07:22:35 +01:00