Added (or rather repurposed) field for build date to settings structure in preparation for coming changes.

Added code guards in order to free some memory for STM32F103 variants with 128K flash.
Changed Stop (0x19) real-time command behaviour, active tool offset and coordinate system will now be kept. Ref. issue #610.
This commit is contained in:
Terje Io
2024-11-29 18:17:26 +01:00
parent f8f10aecdf
commit 8fee2930f5
11 changed files with 80 additions and 14 deletions
+38
View File
@@ -1,5 +1,43 @@
## grblHAL changelog
<a name="20241128">Build 20241128
Core:
* Added (or rather repurposed) field for build date to settings structure in preparation for coming changes.
* Added code guards in order to free some memory for STM32F103 variants with 128K flash. Ref. [STM32F1xx driver issue #59](https://github.com/grblHAL/STM32F1xx/issues/59).
* Changed Stop (`0x19`) real-time command behaviour, active tool offset and coordinate system will now be kept. Ref. [issue #610](https://github.com/grblHAL/core/issues/610).
Drivers:
* All: updated for core change (settings structure).
* SAM3X8E: fixed missing probe input for Protoneer v3 board. Ref. [issue #31](https://github.com/grblHAL/SAM3X8E/issues/31)
* RP2040: switched to SDK v2.0.0 and added initial support for RP2350 (Pico 2). The Web Builder will be updated a little later for this change.
Plugins:
* Trinamic: removed superfluous semicolon.Ref. [issue #15](https://github.com/grblHAL/Plugins_motor/issues/15).
* Networking: added some files to _CMakeLists.txt_, used by RP2350 driver.
---
<a name="20241121">Build 20241121
Core:
* downgrading settings reset backup
Plugins:
* Trinamic: removed superfluous semicolon. https://github.com/grblHAL/Plugins_motor/issues/15
---
<a name="20241121">20241121
Core:
+4
View File
@@ -263,6 +263,7 @@ PROGMEM static const pin_name_t pin_names[] = {
{ .function = Input_LimitZ_Max, .name = "Z limit max" },
{ .function = Input_HomeZ, .name = "Z home" },
{ .function = Input_HomeZ_2, .name = "Z home 2" },
#ifndef NO_SETTINGS_DESCRIPTIONS
{ .function = Input_SpindleIndex, .name = "Spindle index" },
{ .function = Input_SpindlePulse, .name = "Spindle pulse" },
{ .function = Input_Aux0, .name = "Aux in 0" },
@@ -285,6 +286,7 @@ PROGMEM static const pin_name_t pin_names[] = {
{ .function = Input_Analog_Aux5, .name = "Aux analog in 5" },
{ .function = Input_Analog_Aux6, .name = "Aux analog in 6" },
{ .function = Input_Analog_Aux7, .name = "Aux analog in 7" },
#endif
{ .function = Output_StepX, .name = "X step" },
{ .function = Output_StepX_2, .name = "X2 step" },
{ .function = Output_StepY, .name = "Y step" },
@@ -344,6 +346,7 @@ PROGMEM static const pin_name_t pin_names[] = {
{ .function = Input_LimitV_Max, .name = "V limit max" },
{ .function = Input_HomeV, .name = "V home" },
#endif
#ifndef NO_SETTINGS_DESCRIPTIONS
{ .function = Output_MotorChipSelect, .name = "Motor CS" },
{ .function = Output_MotorChipSelectX, .name = "Motor CSX" },
{ .function = Output_MotorChipSelectY, .name = "Motor CSY" },
@@ -418,6 +421,7 @@ PROGMEM static const pin_name_t pin_names[] = {
{ .function = Bidirectional_MotorUARTM5, .name = "UART M5" },
{ .function = Bidirectional_MotorUARTM6, .name = "UART M6" },
{ .function = Bidirectional_MotorUARTM7, .name = "UART M7" }
#endif
};
typedef enum {
+11 -2
View File
@@ -288,7 +288,7 @@ plane_t *gc_get_plane_data (plane_t *plane, plane_select_t select)
return plane;
}
void gc_init (void)
void gc_init (bool stop)
{
#if COMPATIBILITY_LEVEL > 1
memset(&gc_state, 0, sizeof(parser_state_t));
@@ -302,11 +302,20 @@ void gc_init (void)
if(grbl.tool_table.n_tools == 0)
memset(grbl.tool_table.tool, 0, sizeof(tool_data_t));
} else {
coord_system_id_t coord_system_id = gc_state.modal.coord_system.id;
tool_offset_mode_t tool_offset_mode = gc_state.modal.tool_offset_mode;
memset(&gc_state, 0, offsetof(parser_state_t, g92_coord_offset));
gc_state.tool_pending = gc_state.tool->tool_id;
if(hal.tool.select)
hal.tool.select(gc_state.tool, false);
// TODO: restore offsets, tool offset mode?
if(stop) {
// Restore offsets, tool offset mode
gc_state.modal.coord_system.id = coord_system_id;
gc_state.modal.tool_offset_mode = tool_offset_mode;
}
}
#endif
+1 -1
View File
@@ -654,7 +654,7 @@ typedef struct {
} parser_block_t;
// Initialize the parser
void gc_init (void);
void gc_init (bool stop);
char *gc_normalize_block (char *block, status_code_t *status, char **message);
+1 -1
View File
@@ -42,7 +42,7 @@
#else
#define GRBL_VERSION "1.1f"
#endif
#define GRBL_BUILD 20241120
#define GRBL_BUILD 20241128
#define GRBL_URL "https://github.com/grblHAL"
+1 -1
View File
@@ -368,7 +368,7 @@ int grbl_enter (void)
// Reset primary systems.
hal.stream.reset_read_buffer(); // Clear input stream buffer
gc_init(); // Set g-code parser to default state
gc_init(false); // Set g-code parser to default state
hal.limits.enable(settings.limits.flags.hard_enabled, (axes_signals_t){0});
plan_reset(); // Clear block buffer and planner variables
st_reset(); // Clear stepper subsystem variables.
+1 -1
View File
@@ -579,7 +579,7 @@ bool protocol_exec_rt_system (void)
sys.flags.keep_input = Off;
gc_init();
gc_init(true);
plan_reset();
if(sys.alarm_pending == Alarm_ProbeProtect) {
st_go_idle();
+9 -2
View File
@@ -54,7 +54,8 @@ const settings_restore_t settings_all = {
PROGMEM const settings_t defaults = {
.version = SETTINGS_VERSION,
.version.id = SETTINGS_VERSION,
// .version.build = (GRBL_BUILD - 20000000UL),
#if DEFAULT_LASER_MODE
.mode = Mode_Laser,
@@ -2367,7 +2368,7 @@ bool read_global_settings ()
settings.control_invert.mask |= limits_override.mask;
settings.control_disable_pullup.mask &= ~limits_override.mask;
return ok && settings.version == SETTINGS_VERSION;
return ok && settings.version.id == SETTINGS_VERSION;
}
@@ -3176,5 +3177,11 @@ void settings_init (void)
details->on_changed(&settings, changed);
} while((details = details->next));
/*
if(!settings.fs_options.downgrading && settings.version.build != (GRBL_BUILD - 20000000UL)) {
settings.version.build = (GRBL_BUILD - 20000000UL);
settings_write_global();
}
*/
setting_details.on_changed = hal.settings_changed;
}
+12 -4
View File
@@ -573,7 +573,7 @@ typedef union {
no_restore_position_after_M6 :1,
no_unlock_after_estop :1;
};
} settingflags_t;
} settingflags_t; // TODO: -> 16 bit
typedef union {
uint8_t value;
@@ -750,7 +750,8 @@ typedef union {
struct {
uint8_t sd_mount_on_boot :1,
lfs_hidden :1,
unused :6;
unused :5,
downgrading :1; // TODO: move to system flags
};
} fs_options_t;
@@ -803,11 +804,18 @@ typedef struct {
toolchange_mode_t mode;
} tool_change_settings_t;
typedef union {
uint32_t value;
struct {
uint32_t id :8; // = SETTINGS_VERSION, incremented on structure changes.
uint32_t build :24; // Build date, format YYMMDD.
};
} settings_version_t;
// Global persistent settings (Stored from byte NVS_ADDR_GLOBAL onwards)
typedef struct {
// Settings struct version
uint32_t version;
// uint32_t build_date; // TODO: add in next settings version?, set to GRBL_BUILD
settings_version_t version;
float junction_deviation;
float arc_tolerance;
float g73_retract;
+1 -1
View File
@@ -218,7 +218,7 @@ Binds motor 0 as a spindle.
*/
bool st2_motor_bind_spindle (uint_fast8_t axis_idx)
{
if(motors && axis_idx > Z_AXIS) {
if(motors && N_AXIS > 3 && axis_idx > Z_AXIS) {
motors->idx = axis_idx;
motors->axis.mask = 1 << axis_idx;
+1 -1
View File
@@ -171,7 +171,7 @@ vfs_file_t *stream_redirect_read (char *filename, status_message_ptr status_hand
void stream_redirect_close (vfs_file_t *file)
{
rd_stream_t *stream = rd_streams, *prev_stream;
rd_stream_t *stream = rd_streams, *prev_stream = NULL;
if(stream) do {
if(stream->file_new == file) {