Skip to content

Commit bbd3b69

Browse files
committed
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.
1 parent 55a9f6a commit bbd3b69

16 files changed

+639
-183
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## grblHAL ##
22

3-
Latest build date is 20250328, see the [changelog](changelog.md) for details.
3+
Latest build date is 20250405, 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.

alarms.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Part of grblHAL
55
6-
Copyright (c) 2017-2022 Terje Io
6+
Copyright (c) 2017-2025 Terje Io
77
Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
88
Copyright (c) 2009-2011 Simen Svale Skogsrud
99
@@ -30,7 +30,7 @@ PROGMEM static const alarm_detail_t alarm_detail[] = {
3030
#ifndef NO_SETTINGS_DESCRIPTIONS
3131
{ Alarm_HardLimit, "Hard limit has been triggered. Machine position is likely lost due to sudden halt. Re-homing is highly recommended." },
3232
{ Alarm_SoftLimit, "Soft limit alarm. G-code motion target exceeds machine travel. Machine position retained. Alarm may be safely unlocked." },
33-
{ Alarm_AbortCycle, "Reset while in motion. Machine position is likely lost due to sudden halt. Re-homing is highly recommended." },
33+
{ Alarm_AbortCycle, "Reset/E-stop while in motion. Machine position is likely lost due to sudden halt. Re-homing is highly recommended." },
3434
{ Alarm_ProbeFailInitial, "Probe fail. Probe is not in the expected initial state before starting probe cycle when G38.2 and G38.3 is not triggered and G38.4 and G38.5 is triggered." },
3535
{ Alarm_ProbeFailContact, "Probe fail. Probe did not contact the workpiece within the programmed travel for G38.2 and G38.4." },
3636
{ Alarm_HomingFailReset, "Homing fail. The active homing cycle was reset." },

changelog.md

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

3+
<a name="20250405">Build 20250405
4+
5+
Core:
6+
7+
* Added new mid/low level HAL/API to ioports \(auxiliary ports\), makes it simpler to add ports both for base drivers and "standard"/third party plugins.
8+
Ports/pins added via the new HAL/API can be "claimed" by plugin code or used by 'M62' - 'M68' M-codes.
9+
10+
* Added '$709' setting for second PWM spindle when available, same functionality as '$9' - _PWM options_.
11+
12+
* Added properties to PWM spindles to allow "overdriving" PWM output when _RPM controls spindle _enable signal_ is enabled with '$9' or '$709'.
13+
This may [improve CO2 laser engraving](https://github.com/grblHAL/core/issues/721#issuecomment-2776210888), especially for short "pixels".
14+
15+
* Optimized Modbus CRC calculation, may fix issue with a compiler generating different code compared to most others. Ref. issue [#723](https://github.com/grblHAL/core/issues/723).
16+
17+
Drivers:
18+
19+
* All: Updated to use new low level ioports HAL/API.
20+
21+
* Some: Moved support code for MCP3221 I2C ADC to shared plugin. Updated to support PWM "overdrive" mentioned above.
22+
23+
* STM32F4xx: Fixed bug/regression in the core causing spindle encoder to spindle binding to fail. Ref. STM32F4xx issue [#149](https://github.com/grblHAL/STM32F4xx/issues/149#issuecomment-2777509562).
24+
25+
Plugins:
26+
27+
* Misc: added MCP3221 I2C ADC plugin.
28+
29+
* Laser: added plugin for PWM "overdrive" support, adds 'M129P<n>' M-code where '<n>' is percentage of current 'S'-value to add as overdrive.
30+
Fixed minor bug in PPI plugin interfering with the new PWM "overdrive" plugin.
31+
32+
---
33+
334
<a name="20250329">Build 20250329
435

536
Core:

coolant_control.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void coolant_set_state (coolant_state_t mode)
4848
hal.coolant.set_state(mode);
4949
if(mode.value && settings.coolant.on_delay)
5050
delay_sec((float)settings.coolant.on_delay / 1000.0f, DelayMode_Dwell);
51+
system_add_rt_report(Report_Coolant);
5152
}
5253
}
5354

crc.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ uint16_t grbl_crc8 (const uint8_t *buf, uint32_t size)
3737
// Lifted from his FreeModbus Libary
3838
uint16_t modbus_crc16x (const uint8_t *buf, uint_fast16_t len)
3939
{
40+
uint_fast8_t i;
4041
uint16_t crc = 0xFFFF;
41-
uint_fast8_t pos, i;
42-
43-
for (pos = 0; pos < len; pos++) {
44-
crc ^= (uint16_t)buf[pos]; // XOR byte into least sig. byte of crc
45-
for (i = 8; i != 0; i--) { // Loop over each bit
46-
if ((crc & 0x0001) != 0) { // If the LSB is set
47-
crc >>= 1; // Shift right and XOR 0xA001
42+
43+
while(len--) {
44+
crc ^= (uint16_t)*buf++;; // XOR byte into least sig. byte of crc
45+
for(i = 8; i != 0; i--) { // Loop over each bit
46+
if(crc & 0x0001) { // If the LSB is set
47+
crc >>= 1; // Shift right and XOR 0xA001
4848
crc ^= 0xA001;
49-
} else // Else LSB is not set
50-
crc >>= 1; // Just shift right
49+
} else // Else LSB is not set
50+
crc >>= 1; // Just shift right
5151
}
5252
}
5353

driver_opts2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#warning "Selected spindle is not supported!"
4040
#endif
4141

42-
#if (DRIVER_SPINDLE1_ENABLE & SPINDLE_PWM) && !defined(SPINDLE_PWM_PIN)
42+
#if (DRIVER_SPINDLE1_ENABLE & SPINDLE_PWM) && !defined(SPINDLE1_PWM_PIN)
4343
#warning "Selected spindle 1 is not supported!"
4444
#endif
4545

gcode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3818,6 +3818,7 @@ status_code_t gc_execute_block (char *block)
38183818
FAIL(status);
38193819

38203820
plan_data.spindle.state.synchronized = On;
3821+
plan_data.overrides.feed_hold_disable = On; // Disable feed hold.
38213822

38223823
mc_line(gc_block.values.xyz, &plan_data);
38233824

gcode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ typedef enum {
253253
LaserPPI_Enable = 126, //!< 126 - M126
254254
LaserPPI_Rate = 127, //!< 127 - M127
255255
LaserPPI_PulseLength = 128, //!< 128 - M128
256+
Laser_Overdrive = 129, //!< 129 - M129
256257
RGB_WriteLEDs = 150, //!< 150 - M150, Marlin format
257258
Plasma_SelectMaterial = 190, //!< 150 - M190, LinuxCNC format
258259
OpenPNP_SetJerk = 20130, //!< 20130 - M201.3

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 20250329
45+
#define GRBL_BUILD 20250405
4646

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

0 commit comments

Comments
 (0)