mirror of
https://github.com/grblHAL/core.git
synced 2026-02-06 00:52:35 +08:00
Hardened" serial stream registration, now allows empty descriptor.
Now returns no data for alarm and error enums when firmware is compiled for 128K versions of the STM32F1xx MCU. This frees up some flash space for plugins etc.
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 20230919, see the [changelog](changelog.md) for details.
|
||||
Latest build date is 20230926, 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.
|
||||
|
||||
5
alarms.c
5
alarms.c
@@ -27,6 +27,7 @@
|
||||
#include "core_handlers.h"
|
||||
|
||||
PROGMEM static const alarm_detail_t alarm_detail[] = {
|
||||
#ifndef NO_SETTINGS_DESCRIPTIONS
|
||||
{ Alarm_HardLimit, "Hard limit has been triggered. Machine position is likely lost due to sudden halt. Re-homing is highly recommended." },
|
||||
{ Alarm_SoftLimit, "Soft limit alarm. G-code motion target exceeds machine travel. Machine position retained. Alarm may be safely unlocked." },
|
||||
{ Alarm_AbortCycle, "Reset while in motion. Machine position is likely lost due to sudden halt. Re-homing is highly recommended." },
|
||||
@@ -45,6 +46,7 @@ PROGMEM static const alarm_detail_t alarm_detail[] = {
|
||||
{ Alarm_SelftestFailed, "Power on selftest (POS) failed." },
|
||||
{ Alarm_MotorFault, "Motor fault." },
|
||||
{ Alarm_HomingFail, "Homing fail. Bad configuration." }
|
||||
#endif // NO_SETTINGS_DESCRIPTIONS
|
||||
};
|
||||
|
||||
static alarm_details_t details = {
|
||||
@@ -72,8 +74,7 @@ const char *alarms_get_description (alarm_code_t id)
|
||||
alarm_details_t *details = grbl.on_get_alarms();
|
||||
|
||||
do {
|
||||
n_alarms = details->n_alarms;
|
||||
do {
|
||||
if((n_alarms = details->n_alarms)) do {
|
||||
if(details->alarms[--n_alarms].id == id)
|
||||
description = details->alarms[n_alarms].description;
|
||||
} while(description == NULL && n_alarms);
|
||||
|
||||
35
changelog.md
35
changelog.md
@@ -1,5 +1,38 @@
|
||||
## grblHAL changelog
|
||||
|
||||
<a name="20230926"/>Build 20230926
|
||||
|
||||
Core:
|
||||
|
||||
* "hardened" serial stream registration, now allows empty descriptor.
|
||||
|
||||
* now returns no data for alarm and error enums when firmware is compiled for 128K versions of STM32F1xx MCU.
|
||||
This frees up some flash space for plugins etc.
|
||||
|
||||
Drivers:
|
||||
|
||||
* STM32F1xx: refactored serial \(UART\) driver code.
|
||||
All ports enabled by a board is now registered with the core at startup and can be claimed by plugin code if unused.
|
||||
|
||||
* STM32F4xx: refactored serial \(UART\) driver code and added option for 3rd port/stream.
|
||||
All ports enabled by a board is now registered with the core at startup and can be claimed by plugin code if unused.
|
||||
Switched to DMA for SD card transfers in SPI mode and increased clock frequency.
|
||||
Added tentative board map for MKS Robin Nano v3.
|
||||
|
||||
* STM32F7xx: refactored serial \(UART\) driver code and added option for 3rd port/stream.
|
||||
All ports enabled by a board is now registered with the core at startup and can be claimed by plugin code if unused.
|
||||
Added step injection code for plasma plugin.
|
||||
|
||||
* iMXRT1062: extended step injection code for plasma plugin.
|
||||
|
||||
Plugins:
|
||||
|
||||
* Spindle: for developers; harmonized Modbus serial stream selection symbol, old symbol name retained and marked as deprecated.
|
||||
|
||||
* Plasma: some minor bug fixes, added check for presence of driver step injection code.
|
||||
|
||||
---
|
||||
|
||||
<a name="20230919"/>Build 20230919
|
||||
|
||||
Core:
|
||||
@@ -8,7 +41,7 @@ Core:
|
||||
|
||||
Plugins:
|
||||
|
||||
* Spindle: fix for {issue #22](https://github.com/grblHAL/Plugins_spindle/issues/22), H100 VFD driver not working.
|
||||
* Spindle: fix for [issue #22](https://github.com/grblHAL/Plugins_spindle/issues/22), H100 VFD driver not working.
|
||||
|
||||
Drivers:
|
||||
|
||||
|
||||
@@ -86,6 +86,10 @@
|
||||
#define USB_SERIAL_WAIT 0
|
||||
#endif
|
||||
|
||||
#if USB_SERIAL_CDC == 0 && !defined(SERIAL_STREAM)
|
||||
#define SERIAL_STREAM 0
|
||||
#endif
|
||||
|
||||
#ifndef KEYPAD_ENABLE
|
||||
#define KEYPAD_ENABLE 0
|
||||
#endif
|
||||
@@ -162,9 +166,12 @@
|
||||
#define TRINAMIC_ENABLE 0
|
||||
#endif
|
||||
#if TRINAMIC_ENABLE == 2209
|
||||
#if !defined(TRINAMIC_UART_ENABLE)
|
||||
#ifndef TRINAMIC_UART_ENABLE)
|
||||
#define TRINAMIC_UART_ENABLE 1
|
||||
#endif
|
||||
#if !defined(TRINAMIC_STREAM) && TRINAMIC_UART_ENABLE == 1
|
||||
#define TRINAMIC_STREAM 1
|
||||
#endif
|
||||
#else
|
||||
#define TRINAMIC_UART_ENABLE 0
|
||||
#endif
|
||||
@@ -196,11 +203,17 @@
|
||||
#endif
|
||||
#ifndef PLASMA_ENABLE
|
||||
#define PLASMA_ENABLE 0
|
||||
#else
|
||||
#define STEP_INJECT_ENABLE 1
|
||||
#endif
|
||||
#ifndef PPI_ENABLE
|
||||
#define PPI_ENABLE 0
|
||||
#endif
|
||||
|
||||
#ifndef STEP_INJECT_ENABLE
|
||||
#define STEP_INJECT_ENABLE 1
|
||||
#endif
|
||||
|
||||
#if EMBROIDERY_ENABLE
|
||||
#if defined(SDCARD_ENABLE) && SDCARD_ENABLE == 0
|
||||
#undef SDCARD_ENABLE
|
||||
|
||||
5
errors.c
5
errors.c
@@ -27,6 +27,7 @@
|
||||
#include "core_handlers.h"
|
||||
|
||||
PROGMEM static const status_detail_t status_detail[] = {
|
||||
#ifndef NO_SETTINGS_DESCRIPTIONS
|
||||
{ Status_OK, NULL },
|
||||
{ Status_ExpectedCommandLetter, "G-code words consist of a letter and a value. Letter was not found." },
|
||||
{ Status_BadNumberFormat, "Missing the expected G-code word value or numeric value format is not valid." },
|
||||
@@ -103,6 +104,7 @@ PROGMEM static const status_detail_t status_detail[] = {
|
||||
{ Status_FlowControlStackOverflow, "Stack overflow while executing flow statement." },
|
||||
{ Status_FlowControlOutOfMemory, "Out of memory while executing flow statement." }
|
||||
#endif
|
||||
#endif // NO_SETTINGS_DESCRIPTIONS
|
||||
};
|
||||
|
||||
static error_details_t details = {
|
||||
@@ -130,8 +132,7 @@ const char *errors_get_description (status_code_t id)
|
||||
error_details_t *details = grbl.on_get_errors();
|
||||
|
||||
do {
|
||||
n_errors = details->n_errors;
|
||||
do {
|
||||
if((n_errors = details->n_errors)) do {
|
||||
if(details->errors[--n_errors].id == id)
|
||||
description = details->errors[n_errors].description;
|
||||
} while(description == NULL && n_errors);
|
||||
|
||||
2
grbl.h
2
grbl.h
@@ -42,7 +42,7 @@
|
||||
#else
|
||||
#define GRBL_VERSION "1.1f"
|
||||
#endif
|
||||
#define GRBL_BUILD 20230919
|
||||
#define GRBL_BUILD 20230926
|
||||
|
||||
#define GRBL_URL "https://github.com/grblHAL"
|
||||
|
||||
|
||||
3
hal.h
3
hal.h
@@ -598,7 +598,8 @@ typedef struct {
|
||||
nvs_io_t nvs; //!< Optional handlers for storing/retrieving settings and data to/from non-volatile storage (NVS).
|
||||
enumerate_pins_ptr enumerate_pins; //!< Optional handler for enumerating pins used by the driver.
|
||||
bool (*driver_release)(void); //!< Optional handler for releasing hardware resources before exiting.
|
||||
uint32_t (*get_elapsed_ticks)(void); //!< Optional handler for getting number of elapsed 1ms tics since startup. Required by a number of plugins.
|
||||
uint32_t (*get_elapsed_ticks)(void); //!< Optional handler for getting number of elapsed 1 ms tics since startup. Rolls over every 49.71 days. Required by a number of plugins.
|
||||
uint32_t (*get_micros)(void); //!< Optional handler for getting number of elapsed 1 us tics since startup. Rolls over every 1.19 hours. Required by a number of plugins.
|
||||
pallet_shuttle_ptr pallet_shuttle; //!< Optional handler for performing a pallet shuttle on program end (M60).
|
||||
void (*reboot)(void); //!< Optoional handler for rebooting the controller. This will be called when #ASCII_ESC followed by #CMD_REBOOT is received.
|
||||
|
||||
|
||||
@@ -28,6 +28,11 @@
|
||||
trinamic_init();
|
||||
#endif
|
||||
|
||||
#if PLASMA_ENABLE
|
||||
extern void plasma_init (void);
|
||||
plasma_init();
|
||||
#endif
|
||||
|
||||
#if MODBUS_ENABLE && MODBUS_ENABLE & 0x01
|
||||
extern void modbus_rtu_init (void);
|
||||
modbus_rtu_init();
|
||||
|
||||
6
stream.c
6
stream.c
@@ -72,8 +72,10 @@ static stream_write_char_ptr mpg_write_char = NULL;
|
||||
|
||||
void stream_register_streams (io_stream_details_t *details)
|
||||
{
|
||||
details->next = streams;
|
||||
streams = details;
|
||||
if(details->n_streams) {
|
||||
details->next = streams;
|
||||
streams = details;
|
||||
}
|
||||
}
|
||||
|
||||
bool stream_enumerate_streams (stream_enumerate_callback_ptr callback)
|
||||
|
||||
Reference in New Issue
Block a user