From f1b1776bdcd52d432ab6e3f7808678532c2f9bfb Mon Sep 17 00:00:00 2001 From: Terje Io Date: Tue, 18 Jul 2023 11:47:09 +0200 Subject: [PATCH] Some tweaks for new Web Builder options++ --- changelog.md | 8 ++++++++ gcode.h | 1 + grbl.h | 2 +- my_plugin.c | 6 +++++- report.c | 4 ++-- spindle_control.c | 5 +++-- spindle_control.h | 4 ++-- 7 files changed, 22 insertions(+), 8 deletions(-) diff --git a/changelog.md b/changelog.md index 78643be..d4ca868 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,14 @@ Core: +* Some tweaks for new Web Builder options++ + +--- + +20230714 + +Core: + * Added support for traversing directory structure across file system mounts. Allows access to littlefs mount via ftp. * Fixed inconsistent \(random\) real-time reporting of cycle start signal by adding a latch to ensure it is reported at least once. diff --git a/gcode.h b/gcode.h index c7d5c37..f66d713 100644 --- a/gcode.h +++ b/gcode.h @@ -236,6 +236,7 @@ typedef enum { LaserPPI_Rate = 127, //!< 127 - M127 LaserPPI_PulseLength = 128, //!< 128 - M128 OpenPNP_SetAcceleration = 204, //!< 204 - M204 + RGB_Inspection_Light = 356, //!< 356 - M356 OpenPNP_FinishMoves = 400, //!< 400 - M400 Probe_Deploy = 401, //!< 401 - M401, Marlin format Probe_Stow = 402, //!< 402 - M402, Marlin format diff --git a/grbl.h b/grbl.h index 30807e2..7c81836 100644 --- a/grbl.h +++ b/grbl.h @@ -42,7 +42,7 @@ #else #define GRBL_VERSION "1.1f" #endif -#define GRBL_BUILD 20230714 +#define GRBL_BUILD 20230718 #define GRBL_URL "https://github.com/grblHAL" diff --git a/my_plugin.c b/my_plugin.c index 7409901..d84d6a2 100644 --- a/my_plugin.c +++ b/my_plugin.c @@ -5,7 +5,7 @@ Part of grblHAL - Copyright (c) 2020 Terje Io + Copyright (c) 2020-2023 Terje Io Grbl is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,7 +21,11 @@ along with Grbl. If not, see . */ +#ifndef ADD_MY_PLUGIN + __attribute__((weak)) void my_plugin_init (void) { // NOOP } + +#endif diff --git a/report.c b/report.c index 2c10694..d7ffcf9 100644 --- a/report.c +++ b/report.c @@ -2169,7 +2169,7 @@ status_code_t report_time (void) return ok ? Status_OK : Status_InvalidStatement; } -static void report_spindle (spindle_info_t *spindle) +static void report_spindle (spindle_info_t *spindle, void *data) { hal.stream.write(uitoa(spindle->id)); hal.stream.write(" - "); @@ -2187,7 +2187,7 @@ static void report_spindle (spindle_info_t *spindle) status_code_t report_spindles (void) { - if(!spindle_enumerate_spindles(report_spindle)) + if(!spindle_enumerate_spindles(report_spindle, NULL)) hal.stream.write("No spindles registered." ASCII_EOL); return Status_OK; diff --git a/spindle_control.c b/spindle_control.c index c2e93e4..9c136b3 100644 --- a/spindle_control.c +++ b/spindle_control.c @@ -308,9 +308,10 @@ static spindle_num_t spindle_get_num (spindle_id_t spindle_id) /*! \brief Enumerate registered spindles by calling a callback function for each of them. \param callback pointer to a \ref spindle_enumerate_callback_ptr type function. +\param data pointer to optional data to pass to the callback function. \returns \a true if spindles are registered and a callback function was provided, \a false otherwise. */ -bool spindle_enumerate_spindles (spindle_enumerate_callback_ptr callback) +bool spindle_enumerate_spindles (spindle_enumerate_callback_ptr callback, void *data) { if(callback == NULL || n_spindle == 0) return false; @@ -327,7 +328,7 @@ bool spindle_enumerate_spindles (spindle_enumerate_callback_ptr callback) spindle.enabled = spindle.num != -1; spindle.is_current = spindle.enabled && sys_spindle[0].hal.id == idx; - callback(&spindle); + callback(&spindle, data); } return true; diff --git a/spindle_control.h b/spindle_control.h index 6a0411c..1a96ba3 100644 --- a/spindle_control.h +++ b/spindle_control.h @@ -234,7 +234,7 @@ typedef struct { /*! \brief Pointer to callback function called by spindle_enumerate_spindles(). \param spindle prointer to a \a spindle_info_t struct. */ -typedef void (*spindle_enumerate_callback_ptr)(spindle_info_t *spindle); +typedef void (*spindle_enumerate_callback_ptr)(spindle_info_t *spindle, void *data); void spindle_set_override (spindle_ptrs_t *spindle, override_t speed_override); @@ -281,7 +281,7 @@ spindle_id_t spindle_get_default (void); spindle_num_t spindle_enable (spindle_id_t spindle_id); -bool spindle_enumerate_spindles (spindle_enumerate_callback_ptr callback); +bool spindle_enumerate_spindles (spindle_enumerate_callback_ptr callback, void *data); //