Skip to content

Commit c8c77c3

Browse files
committed
Added some new plugin init calls and setting ids.
Added defaults for RGB strip lengths.
1 parent 7725fab commit c8c77c3

File tree

9 files changed

+151
-5
lines changed

9 files changed

+151
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ It has been written to complement grblHAL and has features such as proper keyboa
1313

1414
---
1515

16-
Latest build date is 20240817, see the [changelog](changelog.md) for details.
16+
Latest build date is 20240903, see the [changelog](changelog.md) for details.
1717

1818
__NOTE:__ Build 20240222 has moved the probe input to the ioPorts pool of inputs and will be allocated from it when configured.
1919
The change is major and _potentially dangerous_, it may damage your probe, so please _verify correct operation_ after installing this, or later, builds.

changelog.md

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

3+
<a name="20240903">Build 20240903
4+
5+
Core:
6+
7+
* Added some new plugin init calls and setting ids. Added defaults for RGB strip lengths.
8+
9+
Drivers:
10+
11+
* ESP32, RP2040, STM32F4xx, STM32F7xx: updated for core changes related to the RGB HAL.
12+
13+
* RP2040: renamed bluetooth files to avoid conflict with SDK.
14+
15+
* STM32F7xx: moved board maps to separate directory.
16+
17+
Plugins:
18+
19+
* SD card: removed superfluous code. Made _.macro_ file type visible by default. Ref. [ioSender issue #403](https://github.com/terjeio/ioSender/issues/403).
20+
21+
* Misc: initial commit of [new plugins](https://github.com/grblHAL/Plugins_misc), some moved from [Templates](https://github.com/grblHAL/Templates/tree/master/my_plugin).
22+
23+
* WebUI: now delays soft reset commands for ESP32 driver to avoid crash when more than 3 axes are enabled. Ref. [issue #15](https://github.com/grblHAL/Plugin_WebUI/issues/15)
24+
25+
---
26+
27+
<a name="20240827">Build 20240827
28+
29+
Core:
30+
31+
* Added setting definitions for plugins and some new plugin initialization calls.
32+
33+
Drivers:
34+
35+
* ESP32: changed spindle on signal to GPIO32 when On/Off spindle is configured for MKS DLC32 board. Ref. this [discussion](https://github.com/grblHAL/core/discussions/203#discussioncomment-10454788).
36+
37+
* RP2040: fixed build issues when native Bluetooth is enabled. Ref. [issue #94](https://github.com/grblHAL/RP2040/issues/94).
38+
39+
Plugins:
40+
41+
* Spindle: added "Offset" plugin for spindle \(laser\) movement to be executed when switching between spindles.
42+
43+
* WebUI: workaround for [issue #15](https://github.com/grblHAL/Plugin_WebUI/issues/15), ESP32 crash on soft reset when > 3 axes configured.
44+
45+
* Miscellaneous: added a number of smallish plugins; BLTouch, PWM servo, EventOut, RGB LED strips, RGB LED M150. These are work in progress and requires specific driver configurations.
46+
47+
---
48+
349
<a name="20240817">Build 20240817
450

551
Core:

config.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,24 @@ Timezone offset from UTC in hours, allowed range is -12.0 - 12.0.
17931793
#endif
17941794
///@}
17951795

1796+
/*! @name $536 - Setting_RGB_StripLengt0
1797+
Number of LEDs in NeoPixel/WS2812 strip 1.
1798+
*/
1799+
///@{
1800+
#if !defined DEFAULT_RGB_STRIP0_LENGTH || defined __DOXYGEN__
1801+
#define DEFAULT_RGB_STRIP0_LENGTH 0
1802+
#endif
1803+
///@}
1804+
1805+
/*! @name $537 - Setting_RGB_StripLengt1
1806+
Number of LEDs in NeoPixel/WS2812 strip 2.
1807+
*/
1808+
///@{
1809+
#if !defined DEFAULT_RGB_STRIP1_LENGTH || defined __DOXYGEN__
1810+
#define DEFAULT_RGB_STRIP1_LENGTH 0
1811+
#endif
1812+
///@}
1813+
17961814
/*! @name $538 - Setting_RotaryWrap
17971815
Enable fast return to G28 position for rotary axes by \ref axismask.
17981816
Use:

gcode.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,26 @@ typedef union {
360360
#endif
361361
#ifdef V_AXIS
362362
float v;
363+
#endif
364+
};
365+
struct {
366+
float m0;
367+
float m1;
368+
float m2;
369+
#if N_AXIS > 3
370+
float m3;
371+
#endif
372+
#if N_AXIS > 4
373+
float m4;
374+
#endif
375+
#if N_AXIS > 5
376+
float m5;
377+
#endif
378+
#if N_AXIS > 6
379+
float m6;
380+
#endif
381+
#if N_AXIS == 8
382+
float m7;
363383
#endif
364384
};
365385
} coord_data_t;

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 20240817
45+
#define GRBL_BUILD 20240903
4646

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

nuts_bolts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ bool delay_sec (float seconds, delaymode_t mode)
319319
while(--i && ok) {
320320
if(mode == DelayMode_Dwell)
321321
ok = protocol_execute_realtime();
322-
else // DelayMode_SysSuspende, xecute rt_system() only to avoid nesting suspend loops.
322+
else // DelayMode_SysSuspend, execute rt_system() only to avoid nesting suspend loops.
323323
ok = protocol_exec_rt_system() && !state_door_reopened(); // Bail, if safety door reopens.
324324
if(ok)
325325
hal.delay_ms(DWELL_TIME_STEP, NULL); // Delay DWELL_TIME_STEP increment

plugins_init.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,21 @@
118118
embroidery_init();
119119
#endif
120120

121+
#if RGB_LED_ENABLE
122+
extern void rgb_led_init (void);
123+
rgb_led_init();
124+
#endif
125+
121126
extern void my_plugin_init (void);
122127
my_plugin_init();
123128

124129
#if N_SPINDLE > 1
125130
extern void spindle_select_init(void);
126131
spindle_select_init();
132+
#if SPINDLE_OFFSET == 1
133+
extern void spindle_offset_init (void);
134+
spindle_offset_init();
135+
#endif
127136
#endif
128137

129138
// Third party plugin definitions.
@@ -166,6 +175,11 @@
166175
panel_init();
167176
#endif
168177

178+
#if EVENTOUT_ENABLE
179+
extern void event_out_init (void);
180+
event_out_init();
181+
#endif
182+
169183
// End third party plugin definitions.
170184

171185
#if ODOMETER_ENABLE

settings.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,10 @@ PROGMEM const settings_t defaults = {
308308
.safety_door.flags.ignore_when_idle = DEFAULT_DOOR_IGNORE_WHEN_IDLE,
309309
.safety_door.flags.keep_coolant_on = DEFAULT_DOOR_KEEP_COOLANT_ON,
310310
.safety_door.spindle_on_delay = DEFAULT_SAFETY_DOOR_SPINDLE_DELAY,
311-
.safety_door.coolant_on_delay = DEFAULT_SAFETY_DOOR_COOLANT_DELAY
311+
.safety_door.coolant_on_delay = DEFAULT_SAFETY_DOOR_COOLANT_DELAY,
312+
313+
.rgb_strip0_length = DEFAULT_RGB_STRIP0_LENGTH,
314+
.rgb_strip1_length = DEFAULT_RGB_STRIP1_LENGTH
312315
};
313316

314317
static bool group_is_available (const setting_group_detail_t *group)
@@ -1461,7 +1464,11 @@ inline static setting_id_t normalize_id (setting_id_t id)
14611464
id = (setting_id_t)(Setting_EncoderSettingsBase + (id % ENCODER_SETTINGS_INCREMENT));
14621465
else if(id > Setting_ModbusTCPBase && id <= Setting_ModbusTCPMax)
14631466
id = (setting_id_t)(Setting_ModbusTCPBase + (id % MODBUS_TCP_SETTINGS_INCREMENT));
1464-
else if((id > Setting_Macro0 && id <= Setting_Macro9) || (id > Setting_MacroPort0 && id <= Setting_MacroPort9) || (id > Setting_ButtonAction0 && id <= Setting_ButtonAction9))
1467+
else if((id > Setting_Macro0 && id <= Setting_Macro9) ||
1468+
(id > Setting_MacroPort0 && id <= Setting_MacroPort9) ||
1469+
(id > Setting_ButtonAction0 && id <= Setting_ButtonAction9) ||
1470+
(id > Setting_Action0 && id <= Setting_Action9) ||
1471+
(id > Setting_ActionPort0 && id <= Setting_ActionPort9))
14651472
id = (setting_id_t)(id - (id % 10));
14661473

14671474
return id;
@@ -2315,11 +2322,16 @@ void settings_restore (settings_restore_t restore)
23152322
settings_write_build_info(BUILD_INFO);
23162323
}
23172324

2325+
if(restore.defaults && hal.settings_changed)
2326+
hal.settings_changed(&settings, (settings_changed_flags_t){-1});
2327+
23182328
setting_details_t *details = setting_details.next;
23192329

23202330
if(details) do {
23212331
if(details->restore)
23222332
details->restore();
2333+
if(details->on_changed)
2334+
details->on_changed(&settings, restore.defaults ? (settings_changed_flags_t){-1} : (settings_changed_flags_t){0});
23232335
} while((details = details->next));
23242336

23252337
nvs_buffer_sync_physical();

settings.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,17 +459,53 @@ typedef enum {
459459
Setting_PWMOffValue1 = 734,
460460
Setting_PWMMinValue1 = 735,
461461
Setting_PWMMaxValue1 = 736,
462+
462463
// Optional driver implemented settings for piecewise linear spindle PWM algorithm
463464
Setting_LinearSpindle1Piece1 = 737,
464465
Setting_LinearSpindle1Piece2 = 738,
465466
Setting_LinearSpindle1Piece3 = 739,
466467
Setting_LinearSpindle1Piece4 = 740,
468+
469+
Setting_Action0 = 750,
470+
Setting_ActionBase = Setting_Action0,
471+
Setting_Action1 = 751,
472+
Setting_Action2 = 752,
473+
Setting_Action3 = 753,
474+
Setting_Action4 = 754,
475+
Setting_Action5 = 755,
476+
Setting_Action6 = 756,
477+
Setting_Action7 = 757,
478+
Setting_Action8 = 758,
479+
Setting_Action9 = 759,
480+
481+
Setting_ActionPort0 = 760,
482+
Setting_ActionPortBase = Setting_ActionPort0,
483+
Setting_ActionPort1 = 761,
484+
Setting_ActionPort2 = 762,
485+
Setting_ActionPort3 = 763,
486+
Setting_ActionPort4 = 764,
487+
Setting_ActionPort5 = 765,
488+
Setting_ActionPort6 = 766,
489+
Setting_ActionPort7 = 767,
490+
Setting_ActionPort8 = 768,
491+
Setting_ActionPort9 = 769,
492+
493+
Setting_SpindleOffsetX = 770,
494+
Setting_SpindleOffsetY = 771,
495+
//
496+
// 772-779 - reserved for spindle offset settings
497+
//
498+
467499
//
468500
// 900-999 - reserved for automatic tool changers (ATC)
469501
//
502+
503+
// ---
470504
Setting_SettingsMax,
471505
Setting_SettingsAll = Setting_SettingsMax,
472506

507+
// ---
508+
473509
// Calculated base values for core stepper settings
474510
Setting_AxisStepsPerMM = Setting_AxisSettingsBase,
475511
Setting_AxisMaxRate = Setting_AxisSettingsBase + AXIS_SETTINGS_INCREMENT,

0 commit comments

Comments
 (0)