mirror of
https://github.com/grblHAL/core.git
synced 2026-02-06 09:02:33 +08:00
Fix for Arduino compiler issue with build 20230227. Added core event and removed redundant code.
This commit is contained in:
@@ -13,7 +13,7 @@ It has been written to complement grblHAL and has features such as proper keyboa
|
||||
|
||||
---
|
||||
|
||||
Latest build date is 20230227, see the [changelog](changelog.md) for details.
|
||||
Latest build date is 20230228, see the [changelog](changelog.md) for details.
|
||||
__NOTE:__ A settings reset will be performed on an update of builds earlier than 20230125. Backup and restore of settings is recommended.
|
||||
__IMPORTANT!__ A new setting has been introduced for ganged axes motors in build 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.
|
||||
|
||||
16
changelog.md
16
changelog.md
@@ -1,5 +1,21 @@
|
||||
## grblHAL changelog
|
||||
|
||||
<a name="20230228"/>20230228
|
||||
|
||||
Core:
|
||||
|
||||
* Fix for Arduino compiler issue with build 20230227. Added new core event and removed redundant code.
|
||||
|
||||
Drivers:
|
||||
|
||||
* STM32F4xx: Fixed missing pullup enable for EStop input. __NOTE:__ this may trigger EStop alarm for those who have not wired a switch to this input.
|
||||
|
||||
Plugins:
|
||||
|
||||
* Keypad: I2C display protocol plugin updated to allow multiple message extensions, simplified code.
|
||||
|
||||
---
|
||||
|
||||
<a name="20230227"/>20230227
|
||||
|
||||
Core:
|
||||
|
||||
@@ -81,6 +81,7 @@ typedef bool (*protocol_enqueue_realtime_command_ptr)(char c);
|
||||
typedef void (*on_state_change_ptr)(sys_state_t state);
|
||||
typedef void (*on_override_changed_ptr)(override_changed_t override);
|
||||
typedef void (*on_spindle_programmed_ptr)(spindle_ptrs_t *spindle, spindle_state_t state, float rpm, spindle_rpm_mode_t mode);
|
||||
typedef void (*on_wco_changed_ptr)(void);
|
||||
typedef void (*on_program_completed_ptr)(program_flow_t program_flow, bool check_mode);
|
||||
typedef void (*on_execute_realtime_ptr)(sys_state_t state);
|
||||
typedef void (*on_unknown_accessory_override_ptr)(uint8_t cmd);
|
||||
@@ -117,6 +118,7 @@ typedef struct {
|
||||
on_override_changed_ptr on_override_changed;
|
||||
on_report_handlers_init_ptr on_report_handlers_init;
|
||||
on_spindle_programmed_ptr on_spindle_programmed;
|
||||
on_wco_changed_ptr on_wco_changed;
|
||||
on_program_completed_ptr on_program_completed;
|
||||
on_execute_realtime_ptr on_execute_realtime;
|
||||
on_execute_realtime_ptr on_execute_delay;
|
||||
|
||||
11
gcode.c
11
gcode.c
@@ -319,6 +319,11 @@ void gc_init (void)
|
||||
if (sys.cold_start && !settings.flags.g92_is_volatile && !settings_read_coord_data(CoordinateSystem_G92, &gc_state.g92_coord_offset))
|
||||
grbl.report.status_message(Status_SettingReadFail);
|
||||
|
||||
if(grbl.on_wco_changed && (!sys.cold_start ||
|
||||
!is0_position_vector(gc_state.modal.coord_system.xyz) ||
|
||||
!is0_position_vector(gc_state.g92_coord_offset)))
|
||||
grbl.on_wco_changed();
|
||||
|
||||
// if(settings.flags.lathe_mode)
|
||||
// gc_state.modal.plane_select = PlaneSelect_ZX;
|
||||
}
|
||||
@@ -1065,14 +1070,14 @@ status_code_t gc_execute_block (char *block)
|
||||
if(hal.port.digital_out == NULL || hal.port.num_digital_out == 0)
|
||||
FAIL(Status_GcodeUnsupportedCommand); // [Unsupported M command]
|
||||
word_bit.modal_group.M10 = On;
|
||||
port_command = int_value;
|
||||
port_command = (io_mcode_t)int_value;
|
||||
break;
|
||||
|
||||
case 66:
|
||||
if(hal.port.wait_on_input == NULL || (hal.port.num_digital_in == 0 && hal.port.num_analog_in == 0))
|
||||
FAIL(Status_GcodeUnsupportedCommand); // [Unsupported M command]
|
||||
word_bit.modal_group.M10 = On;
|
||||
port_command = int_value;
|
||||
port_command = (io_mcode_t)int_value;
|
||||
break;
|
||||
|
||||
case 67:
|
||||
@@ -1080,7 +1085,7 @@ status_code_t gc_execute_block (char *block)
|
||||
if(hal.port.analog_out == NULL || hal.port.num_analog_out == 0)
|
||||
FAIL(Status_GcodeUnsupportedCommand); // [Unsupported M command]
|
||||
word_bit.modal_group.M10 = On;
|
||||
port_command = int_value;
|
||||
port_command = (io_mcode_t)int_value;
|
||||
break;
|
||||
/*
|
||||
case 70:
|
||||
|
||||
7
gcode.h
7
gcode.h
@@ -136,9 +136,7 @@ typedef enum {
|
||||
Do not alter values!
|
||||
*/
|
||||
|
||||
typedef uint8_t coord_system_id_t;
|
||||
|
||||
enum coord_system_id_t {
|
||||
typedef enum {
|
||||
CoordinateSystem_G54 = 0, //!< 0 - G54 (G12)
|
||||
CoordinateSystem_G55, //!< 1 - G55 (G12)
|
||||
CoordinateSystem_G56, //!< 2 - G56 (G12)
|
||||
@@ -155,7 +153,8 @@ enum coord_system_id_t {
|
||||
CoordinateSystem_G30, //!< 10 - G30 (G0) when #COMPATIBILITY_LEVEL <= 1, 7 otherwise
|
||||
CoordinateSystem_G92, //!< 11 - G92 (G0) when #COMPATIBILITY_LEVEL <= 1, 8 otherwise
|
||||
N_CoordinateSystems //!< 12 when #COMPATIBILITY_LEVEL <= 1, 9 otherwise
|
||||
};
|
||||
} __attribute__ ((__packed__)) coord_system_id_t;
|
||||
|
||||
|
||||
/*! Modal Group G13: Control mode
|
||||
|
||||
|
||||
2
grbl.h
2
grbl.h
@@ -42,7 +42,7 @@
|
||||
#else
|
||||
#define GRBL_VERSION "1.1f"
|
||||
#endif
|
||||
#define GRBL_BUILD 20230227
|
||||
#define GRBL_BUILD 20230228
|
||||
|
||||
#define GRBL_URL "https://github.com/grblHAL"
|
||||
|
||||
|
||||
@@ -180,6 +180,7 @@ typedef enum {
|
||||
#endif
|
||||
#define clear_vector(a) memset(a, 0, sizeof(a))
|
||||
#define isequal_position_vector(a, b) !memcmp(a, b, sizeof(coord_data_t))
|
||||
#define is0_position_vector(a) !memcmp(a, &((coord_data_t){0}), sizeof(coord_data_t))
|
||||
|
||||
// Bit field and masking macros
|
||||
#ifndef bit
|
||||
|
||||
4
report.c
4
report.c
@@ -1067,15 +1067,13 @@ void report_realtime_status (void)
|
||||
{
|
||||
static bool probing = false;
|
||||
|
||||
int32_t current_position[N_AXIS]; // Copy current state of the system position variable
|
||||
float print_position[N_AXIS];
|
||||
probe_state_t probe_state = {
|
||||
.connected = On,
|
||||
.triggered = Off
|
||||
};
|
||||
|
||||
memcpy(current_position, sys.position, sizeof(sys.position));
|
||||
system_convert_array_steps_to_mpos(print_position, current_position);
|
||||
system_convert_array_steps_to_mpos(print_position, sys.position);
|
||||
|
||||
if(hal.probe.get_state)
|
||||
probe_state = hal.probe.get_state();
|
||||
|
||||
@@ -295,7 +295,7 @@ static spindle_num_t spindle_get_num (spindle_id_t spindle_id)
|
||||
|
||||
do {
|
||||
idx--;
|
||||
if((setting = setting_get_details(idx == 0 ? Setting_SpindleType : Setting_SpindleEnable0 + idx, NULL))) {
|
||||
if((setting = setting_get_details(idx == 0 ? Setting_SpindleType : (setting_id_t)(Setting_SpindleEnable0 + idx), NULL))) {
|
||||
if(setting_get_int_value(setting, 0) == spindle_id)
|
||||
spindle_num = idx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user