Added core event "on_homing_completed", some sanity checks on MPG stream registration.

This commit is contained in:
Terje Io
2022-07-31 11:14:15 +02:00
parent 29527e8705
commit 4b36ffbfbf
7 changed files with 32 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ It has been written to complement grblHAL and has features such as proper keyboa
---
Latest build date is 20220729, see the [changelog](changelog.md) for details.
Latest build date is 20220731, see the [changelog](changelog.md) for details.
__NOTE:__ A settings reset will be performed on an update for versions earlier than 20211122. Backup and restore of settings is recommended.
__IMPORTANT!__ A new setting has been introduced for ganged axes motors in version 20211121.
I have only bench tested this for a couple of drivers, correct function should be verified after updating by those who have more than three motors configured.

View File

@@ -1,5 +1,19 @@
## grblHAL changelog
20220731:
Core:
* Added core event `on_homing_completed`, some sanity checks on MPG stream registration.
Drivers:
* ESP32: Added IP address to "WIFI STA ACTIVE" message published on startup when IP address has been assigned.
* STM32Fxx: Fixed _Release_ build settings, added _.bin_ output.
---
20220729:
Core:
@@ -13,7 +27,7 @@ Plugins:
Drivers:
* ESP32: Switched to plugin code for WebUI login and SD card handling. Still WIP.
__NOTE:__ Settings for WebUI passwords has been moved to the WebUI plugin, this will trigger a reset of the network settings.
__NOTE:__ Settings for WebUI passwords has been moved to the WebUI plugin, this will trigger a reset of the network settings!
* SAM3X8E: Fix for issue [#11](https://github.com/grblHAL/SAM3X8E/issues/11).

View File

@@ -80,6 +80,7 @@ typedef void (*on_unknown_feedback_message_ptr)(stream_write_ptr stream_write);
typedef void (*on_stream_changed_ptr)(stream_type_t type);
typedef bool (*on_laser_ppi_enable_ptr)(uint_fast16_t ppi, uint_fast16_t pulse_length);
typedef void (*on_homing_rate_set_ptr)(axes_signals_t axes, float rate, bool pulloff);
typedef void (*on_homing_completed_ptr)(void);
typedef bool (*on_probe_fixture_ptr)(tool_data_t *tool, bool at_g59_3, bool on);
typedef bool (*on_probe_start_ptr)(axes_signals_t axes, float *target, plan_line_data_t *pl_data);
typedef void (*on_probe_completed_ptr)(void);
@@ -114,6 +115,7 @@ typedef struct {
on_user_command_ptr on_user_command;
on_stream_changed_ptr on_stream_changed;
on_homing_rate_set_ptr on_homing_rate_set;
on_homing_completed_ptr on_homing_completed;
on_probe_fixture_ptr on_probe_fixture;
on_probe_start_ptr on_probe_start;
on_probe_completed_ptr on_probe_completed;

2
grbl.h
View File

@@ -34,7 +34,7 @@
#else
#define GRBL_VERSION "1.1f"
#endif
#define GRBL_BUILD 20220729
#define GRBL_BUILD 20220731
// The following symbols are set here if not already set by the compiler or in config.h
// Do NOT change here!

View File

@@ -934,9 +934,14 @@ status_code_t mc_homing_cycle (axes_signals_t cycle)
sys.report.homed = On;
return settings.limits.flags.hard_enabled && settings.limits.flags.check_at_init && limit_signals_merge(hal.limits.get_state()).value
? Status_LimitsEngaged
: Status_OK;
status_code_t status = settings.limits.flags.hard_enabled && settings.limits.flags.check_at_init && limit_signals_merge(hal.limits.get_state()).value
? Status_LimitsEngaged
: Status_OK;
if(status == Status_OK && grbl.on_homing_completed)
grbl.on_homing_completed();
return status;
}
// Perform tool length probe cycle. Requires probe switch.

View File

@@ -3,7 +3,7 @@
Part of grblHAL
Copyright (c) 2017-2021 Terje Io
Copyright (c) 2017-2022 Terje Io
Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
@@ -360,8 +360,9 @@ void nvs_buffer_sync_physical (void)
settings_dirty.build_info;
} else if(physical_nvs.memcpy_to_flash) {
physical_nvs.memcpy_to_flash(nvsbuffer);
settings_dirty.is_dirty = false;
if(!physical_nvs.memcpy_to_flash(nvsbuffer))
report_message("Settings write failed!", Message_Warning);
memset(&settings_dirty, 0, sizeof(settings_dirty_t));
}
}

View File

@@ -359,7 +359,7 @@ io_stream_t const *stream_open_instance (uint8_t instance, uint32_t baud_rate, s
bool stream_mpg_register (const io_stream_t *stream, bool rx_only, stream_write_char_ptr write_char)
{
if(stream == NULL)
if(stream == NULL || stream->type != StreamType_Serial || stream->disable_rx == NULL)
return false;
base.flags.is_up = On;