Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add experimental support for string registers #603

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fe9b61a
use read_real_value for return statements, so that the returned value…
skasti Sep 26, 2024
4836af9
if no return-value is read, set _value to 0.0f so that we don't carry…
skasti Sep 26, 2024
b148a09
Initial attempt at adding string registers backend-functionality
skasti Oct 9, 2024
33bfb1a
fix warnings from build
skasti Oct 9, 2024
9b2d7b6
rename from ngc_string_registers to string_registers,
skasti Oct 9, 2024
3b05088
remove debug-messages
skasti Oct 9, 2024
58b66f4
Allow setting string-registers using expression
skasti Oct 9, 2024
6b3f6dd
allow exressions
skasti Oct 9, 2024
efe1a6b
combine ifs
skasti Oct 9, 2024
d4951ff
Do not allow setting string registers to values longer than 40 charac…
skasti Oct 9, 2024
3782260
Substitute characters before creating a string register. This allows …
skasti Oct 9, 2024
be6d916
use ampersand as the special character
skasti Oct 10, 2024
9c95b8f
Update copyright header of string_registers.c
skasti Oct 13, 2024
78d8458
cleaning up some leftovers from params, and renaming to MAX_SR_LENGTH
skasti Oct 13, 2024
e6979fb
some code style changes
skasti Oct 13, 2024
59952af
Ensure string registers are not enabled by default, since this is exp…
skasti Oct 13, 2024
dea24e3
reverting stuf from other branch
skasti Oct 23, 2024
012950c
Use realloc to allocate new memory.
skasti Oct 23, 2024
4102648
Set max-length to 256
skasti Oct 23, 2024
072fdb3
Shift neopixel bit pattern
dresco Oct 25, 2024
f830979
Changed _vminor named parameter to contain build date in YYMMDD forma…
terjeio Oct 27, 2024
2c88911
Added init call for new ESP-AT plugin.
terjeio Oct 30, 2024
fe23364
Removed deprecated stream flags, added stream event for line state (R…
terjeio Nov 7, 2024
e769418
Updated changelog
terjeio Nov 7, 2024
a29ae43
Move substitution to a grbl core handler. Move setting of string regi…
skasti Nov 9, 2024
c4febb7
Merge branch 'master' into string-registers
skasti Nov 9, 2024
ba86b00
move init to the end, so the substitution function is declared first
skasti Nov 9, 2024
cd187dc
Use different function names in the files. use correct parameter type
skasti Nov 9, 2024
ba912fa
convert back to other return values
skasti Nov 13, 2024
8ca467b
Base string_register_id_t on ngc_param_id_t, so that they stay in sync
skasti Nov 13, 2024
d3e8b1d
simplify logic for handling setting string-registers, since it now re…
skasti Nov 13, 2024
b2786db
remove newline before {
skasti Nov 14, 2024
5e58e02
linting document for more consistent code style
skasti Nov 14, 2024
8beb863
linting header-file for consistent code-style
skasti Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use ampersand as the special character
skasti committed Oct 23, 2024
commit be6d916208945ccda8f2dae2423665b8b20463af
6 changes: 3 additions & 3 deletions gcode.c
Original file line number Diff line number Diff line change
@@ -578,9 +578,9 @@ char *gc_normalize_block (char *block, char **message)
block++;

#if STRING_REGISTERS_ENABLE
// If the block starts with '@' it means it is setting a string register value,
// If the block starts with '&' it means it is setting a string register value,
// and we should not normalize it
if(*block == '@') {
if(*block == '&') {
return block;
}
#endif
@@ -936,7 +936,7 @@ status_code_t gc_execute_block (char *block)
#endif
}
#if STRING_REGISTERS_ENABLE
} else if (letter == '@') {
} else if (letter == '&') {
if(gc_state.skip_blocks)
return Status_OK;
float register_id;
4 changes: 2 additions & 2 deletions ngc_expr.c
Original file line number Diff line number Diff line change
@@ -979,7 +979,7 @@ char *ngc_substitute_parameters (char *comment, char **message)
else
len += 3; // "N/A"
#if STRING_REGISTERS_ENABLE
} else if (c == '@') {
} else if (c == '&') {
if(read_parameter(comment, &char_counter, &value) == Status_OK) {
if (string_register_get((string_register_id_t)value, &strValue)) {
len += strlen(strValue);
@@ -1024,7 +1024,7 @@ char *ngc_substitute_parameters (char *comment, char **message)
strcat(s, "N/A");
s = strchr(s, '\0');
#if STRING_REGISTERS_ENABLE
} else if (c == '@') {
} else if (c == '&') {
if(read_parameter(comment, &char_counter, &value) == Status_OK) {
if (string_register_get((string_register_id_t)value, &strValue)) {
strcat(s, strValue);