Skip to content

Commit fabec73

Browse files
committed
Added some RGB LED strip properties, improved handling of single meaning G-code words claimed by user M-codes.
1 parent c8c77c3 commit fabec73

File tree

5 files changed

+58
-4
lines changed

5 files changed

+58
-4
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 20240903, see the [changelog](changelog.md) for details.
16+
Latest build date is 20240907, 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: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
## grblHAL changelog
22

3+
<a name="20240907">Build 20240907
4+
5+
Core:
6+
7+
* Added some RGB LED strip properties, improved handling of single meaning G-code words claimed by user M-codes.
8+
9+
Plugins:
10+
11+
* Misc: updated for new RGB LED strip properties.
12+
13+
Drivers:
14+
15+
* iMRX1062, STM32F4xx and STM32F7xx: updated for new RGB LED strip properties.
16+
17+
* RP2040: revised pin mappings for BTT SKR Pico board. Added misc. plugins to compilation.
18+
19+
---
20+
321
<a name="20240903">Build 20240903
422

523
Core:
@@ -8,7 +26,7 @@ Core:
826

927
Drivers:
1028

11-
* ESP32, RP2040, STM32F4xx, STM32F7xx: updated for core changes related to the RGB HAL.
29+
* ESP32, RP2040, STM32F4xx and STM32F7xx: updated for core changes related to the RGB HAL.
1230

1331
* RP2040: renamed bluetooth files to avoid conflict with SDK.
1432

gcode.c

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,12 @@ status_code_t gc_execute_block (char *block)
804804
#endif
805805

806806
char *message = NULL;
807+
struct {
808+
float f;
809+
uint32_t o;
810+
float s;
811+
tool_id_t t;
812+
} single_meaning_value = {0};
807813

808814
block = gc_normalize_block(block, &message);
809815

@@ -1694,7 +1700,22 @@ status_code_t gc_execute_block (char *block)
16941700
ijk_words.j = Off;
16951701
if(user_words.k)
16961702
ijk_words.k = Off;
1697-
1703+
if(user_words.f) {
1704+
single_meaning_value.f = gc_block.values.f;
1705+
gc_block.values.f = 0.0f;
1706+
}
1707+
if(user_words.o) {
1708+
single_meaning_value.o = gc_block.values.o;
1709+
gc_block.values.o = 0;
1710+
}
1711+
if(user_words.s) {
1712+
single_meaning_value.s = gc_block.values.s;
1713+
gc_block.values.s = 0.0f;
1714+
}
1715+
if(user_words.t) {
1716+
single_meaning_value.t = gc_block.values.t;
1717+
gc_block.values.t = (tool_id_t)0;
1718+
}
16981719
axis_words.mask = 0;
16991720
}
17001721

@@ -3313,7 +3334,12 @@ status_code_t gc_execute_block (char *block)
33133334

33143335
if(gc_block.user_mcode_sync)
33153336
protocol_buffer_synchronize(); // Ensure user defined mcode is executed when specified in program.
3337+
33163338
gc_block.words.mask = user_words.mask;
3339+
gc_block.values.f = single_meaning_value.f;
3340+
gc_block.values.o = single_meaning_value.o;
3341+
gc_block.values.s = single_meaning_value.s;
3342+
gc_block.values.t = single_meaning_value.t;
33173343
hal.user_mcode.execute(state_get(), &gc_block);
33183344
gc_block.words.mask = 0;
33193345
}

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

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

rgb.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ typedef union {
4141
};
4242
} rgb_color_t;
4343

44+
typedef union {
45+
uint8_t mask;
46+
struct {
47+
uint8_t is_blocking :1,
48+
is_strip :1,
49+
unassigned :6;
50+
};
51+
} rgb_properties_t;
52+
4453
/*! \brief Pointer to function for setting RGB (LED) output.
4554
\param color a \a rgb_color_t union.
4655
*/
@@ -68,6 +77,7 @@ typedef struct {
6877
rgb_write_ptr write; //!< Optional handler for outputting data to Neopixel strip.
6978
rgb_set_intensity_ptr set_intensity; //!< Optional handler for setting intensity, range 0 - 255.
7079
rgb_color_t cap; //!< Driver capability, color value: 0 - not available, 1 - on off, > 1 - intensity range 0 - n.
80+
rgb_properties_t flags; //!< Driver property flags.
7181
uint16_t num_devices; //!< Number of devices (LEDs) available.
7282
} rgb_ptr_t;
7383

0 commit comments

Comments
 (0)