Skip to content

Commit 5f135ed

Browse files
committed
Added definition for new plasma THC setting and signals for toolsetter.
Added named parameters _probe_state and _toolsetter_state. Both return -1 if state is not available. These may return incorrect values initially so use with care.
1 parent 234c560 commit 5f135ed

12 files changed

+77
-37
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## grblHAL ##
22

3-
Latest build date is 20250114, see the [changelog](changelog.md) for details.
3+
Latest build date is 20250116, see the [changelog](changelog.md) for details.
44

55
> [!NOTE]
66
> A settings reset will be performed on an update of builds prior to 20241208. Backup and restore of settings is recommended.
@@ -93,4 +93,4 @@ G/M-codes not supported by [legacy Grbl](https://github.com/gnea/grbl/wiki) are
9393
Some [plugins](https://github.com/grblHAL/plugins) implements additional M-codes.
9494

9595
---
96-
20250115
96+
20250116

changelog.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
## grblHAL changelog
22

3+
<a name="20250116">Build 20250116
4+
5+
Core:
6+
7+
* Added definition for new plasma THC setting and signals for toolsetter.
8+
9+
* Added named parameters `_probe_state` and `_toolsetter_state`. Both return `-1` if state is not available.
10+
These may return incorrect values initially so use with care.
11+
12+
Drivers:
13+
14+
* STM32F4xx: fixed random freezes when WizNet plugin is enabled for ethernet. Ref. issue [#208](https://github.com/grblHAL/STM32F4xx/issues/208).
15+
Added tentative board map for Sienci SuperLongBoard with external drivers \(SLB EXT\) and added support for toolsetter state for both SLB and SLB EXT.
16+
17+
Plugins:
18+
19+
* Plasma: added new setting `$674` for option flags, virtual ports and Z position sync. Ref. issue [#15](https://github.com/grblHAL/Plugin_plasma/issues/15].
20+
21+
* Motors: added optional support for standstill current reduction on motion end for Trinamic TMC2660 drivers.
22+
Settings `$1` and `$37` controls which drivers are kept on.
23+
24+
---
25+
326
<a name="20250115">20250115
427

528
Plugins:

grbl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#else
4343
#define GRBL_VERSION "1.1f"
4444
#endif
45-
#define GRBL_BUILD 20250114
45+
#define GRBL_BUILD 20250116
4646

4747
#define GRBL_URL "https://github.com/grblHAL"
4848

ioports.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ bool ioport_claim (io_port_type_t type, io_port_direction_t dir, uint8_t *port,
186186

187187
xbar_t *portinfo;
188188

189-
ok = (portinfo = ioport_get_info(type, dir, *port)) && !portinfo->mode.claimed && hal.port.claim(type, dir, port, description);
189+
ok = (portinfo = ioport_get_info(type, dir, *port)) &&
190+
// portinfo->cap.claimable && TODO: add?
191+
!portinfo->mode.claimed &&
192+
hal.port.claim(type, dir, port, description);
190193

191194
} else {
192195

ngc_params.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Part of grblHAL
55
6-
Copyright (c) 2021-2024 Terje Io
6+
Copyright (c) 2021-2025 Terje Io
77
88
grblHAL is free software: you can redistribute it and/or modify
99
it under the terms of the GNU General Public License as published by
@@ -151,6 +151,7 @@ static float probe_result (ngc_param_id_t id)
151151
{
152152
return sys.flags.probe_succeeded ? 1.0f : 0.0f;
153153
}
154+
154155
/*
155156
static float home_pos (ngc_param_id_t id)
156157
{
@@ -407,9 +408,10 @@ PROGMEM static const ngc_named_ro_param_t ngc_named_ro_param[] = {
407408
{ .name = "_selected_tool", .id = NGCParam_selected_tool },
408409
{ .name = "_selected_pocket", .id = NGCParam_selected_pocket },
409410
{ .name = "_call_level", .id = NGCParam_call_level },
411+
{ .name = "_probe_state", .id = NGCParam_probe_state },
412+
{ .name = "_toolsetter_state", .id = NGCParam_toolsetter_state }
410413
};
411414

412-
413415
// Named parameters
414416

415417
float ngc_named_param_get_by_id (ncg_name_param_id_t id)
@@ -613,6 +615,16 @@ float ngc_named_param_get_by_id (ncg_name_param_id_t id)
613615
value = (float)ngc_call_level();
614616
break;
615617

618+
// grblHAL extensions
619+
620+
case NGCParam_probe_state:
621+
value = hal.probe.get_state ? (float)hal.probe.get_state().triggered : -1.0f;
622+
break;
623+
624+
case NGCParam_toolsetter_state:
625+
value = hal.probe.get_state && hal.driver_cap.toolsetter ? (float)hal.probe.get_state().tls_triggered : -1.0f;
626+
break;
627+
616628
default:
617629
value = NAN;
618630
}

ngc_params.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Part of grblHAL
55
6-
Copyright (c) 2021-2024 Terje Io
6+
Copyright (c) 2021-2025 Terje Io
77
88
grblHAL is free software: you can redistribute it and/or modify
99
it under the terms of the GNU General Public License as published by
@@ -100,6 +100,8 @@ typedef enum {
100100
NGCParam_selected_tool,
101101
NGCParam_selected_pocket,
102102
NGCParam_call_level,
103+
NGCParam_probe_state,
104+
NGCParam_toolsetter_state,
103105
NGCParam_Last
104106
} ncg_name_param_id_t;
105107

probe.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Part of grblHAL
55
6-
Copyright (c) 2020-2024 Terje Io
6+
Copyright (c) 2020-2025 Terje Io
77
88
grblHAL is free software: you can redistribute it and/or modify
99
it under the terms of the GNU General Public License as published by
@@ -32,12 +32,13 @@ typedef enum {
3232
typedef union {
3333
uint8_t value;
3434
struct {
35-
uint8_t triggered :1, //<! Set to true when probe is triggered.
36-
connected :1, //<! Set to true when probe is connected. Always set to true if the driver does not have a probe connected input.
37-
inverted :1, //<! For driver use
38-
is_probing :1, //<! For driver use
39-
irq_enabled :1, //<! For driver use
40-
unassigned :3;
35+
uint8_t triggered :1, //<! Set to true when probe or toolsetter is triggered.
36+
connected :1, //<! Set to true when probe is connected. Always set to true if the driver does not have a probe connected input.
37+
inverted :1, //<! For driver use
38+
is_probing :1, //<! For driver use
39+
irq_enabled :1, //<! For driver use
40+
tls_triggered :1, //<! Set to true when toolsetter is triggered.
41+
unassigned :2;
4142
};
4243
} probe_state_t;
4344

settings.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,9 +2316,7 @@ void settings_write_build_info (char *line)
23162316
bool settings_read_build_info(char *line)
23172317
{
23182318
if (!(hal.nvs.type != NVS_None && hal.nvs.memcpy_from_nvs((uint8_t *)line, NVS_ADDR_BUILD_INFO, sizeof(stored_line_t), true) == NVS_TransferResult_OK)) {
2319-
// Reset line with default value
2320-
line[0] = 0; // Empty line
2321-
settings_write_build_info(line);
2319+
settings_restore((settings_restore_t){ .build_info = On });
23222320
return false;
23232321
}
23242322
return true;

settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ typedef enum {
452452
Setting_HomePinsInvertMask = 671,
453453
Setting_Reserved672 = 672,
454454
Setting_CoolantOnDelay = 673,
455+
Setting_THC_Options = 674,
455456

456457
Setting_SpindleInvertMask1 = 716,
457458

spindle_control.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,17 +948,17 @@ static status_code_t set_pwm_port (setting_id_t id, uint_fast16_t int_value)
948948
return ok ? Status_OK : Status_SettingValueOutOfRange;
949949
}
950950

951-
static bool has_pwm (const setting_detail_t *setting)
951+
static bool has_pwm (const setting_detail_t *setting, uint_fast16_t offset)
952952
{
953953
return spindle_cap.variable;
954954
}
955955

956-
static bool has_freq (const setting_detail_t *setting)
956+
static bool has_freq (const setting_detail_t *setting, uint_fast16_t offset)
957957
{
958958
return spindle_cap.variable && !spindle_cap.cloned;
959959
}
960960

961-
static bool has_ports (const setting_detail_t *setting)
961+
static bool has_ports (const setting_detail_t *setting, uint_fast16_t offset)
962962
{
963963
return ports_ok;
964964
}

stream_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Part of grblHAL
55
6-
Copyright (c) 2025 Terje Io
6+
Copyright (c) 2024-2025 Terje Io
77
88
grblHAL is free software: you can redistribute it and/or modify
99
it under the terms of the GNU General Public License as published by

system.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,22 @@ typedef union {
139139
uint16_t mask;
140140
uint16_t value;
141141
struct {
142-
uint16_t reset :1,
143-
feed_hold :1,
144-
cycle_start :1,
145-
safety_door_ajar :1,
146-
block_delete :1,
147-
stop_disable :1, //! M1
148-
e_stop :1,
149-
probe_disconnected :1,
150-
motor_fault :1,
151-
motor_warning :1,
152-
limits_override :1,
153-
single_block :1,
154-
unassigned :1,
155-
probe_overtravel :1, //! used for probe protection
156-
probe_triggered :1, //! used for probe protection
157-
deasserted :1; //! this flag is set if signals are deasserted.
142+
uint16_t reset :1,
143+
feed_hold :1,
144+
cycle_start :1,
145+
safety_door_ajar :1,
146+
block_delete :1,
147+
stop_disable :1, //! M1
148+
e_stop :1,
149+
probe_disconnected :1,
150+
motor_fault :1,
151+
motor_warning :1,
152+
limits_override :1,
153+
single_block :1,
154+
tls_overtravel :1, //! used for probe (toolsetter) protection
155+
probe_overtravel :1, //! used for probe protection
156+
probe_triggered :1, //! used for probe protection
157+
deasserted :1; //! this flag is set if signals are deasserted.
158158
};
159159
} control_signals_t;
160160

0 commit comments

Comments
 (0)