mirror of
https://github.com/grblHAL/core.git
synced 2026-09-21 18:56:19 +08:00
Added shared files for driver motor pins allocation and options handling.
Expanded HAL stream I/O functions. Added doxygen documentation to parts of the code. A number of minor changes to simplify code.
This commit is contained in:
@@ -1,5 +1,23 @@
|
||||
## grblHAL changelog
|
||||
|
||||
Build 20210626:
|
||||
* Standardized handling of motors for ABC- and ganged/squared axes, configuration moved to _my_machine.h_.
|
||||
First number of motors required is calculated, then ABC axes are added from bottom up and then ganged/squared axes from top down.
|
||||
E.g if the board map supports six motors then the following allocations will be made:
|
||||
A-axis and auto-squared Y axis: A-axis -> motor 4 and second Y-axis -> motor 5. Motor 6 pins may then be assigned to auxillary I/O.
|
||||
A-axis, B-axis and ganged X-axis: A-axis -> motor 4 and, B-axis -> motor 5 and second X-axis -> motor 6. Motor 6 limit pin\(s\) if available may be assigned to auxillary I/O.
|
||||
Auto-squared X and Y-axis: second X-axis -> motor 4 and second Y-axis -> motor 5. Motor 6 pins may then be assigned to auxillary I/O.
|
||||
etc...
|
||||
__IMPORTANT:__ For those who have used auto-squared/ganged axes with previous builds be sure to check that the motors allocated matches the current wiring.
|
||||
Tip: use the `$pins` system command to list the pin allocations when checking. Rewire as neccesary.
|
||||
* Added ganged axis/auto-squaring support to some board maps for the [LPC176x](https://github.com/grblHAL/LPC176x) driver.
|
||||
* Expanded on HAL entry points for stream communication and added [initial documentation](http://svn.io-engineering.com/grblHAL/html/hal_8h.html) for the HAL and parts of the core.
|
||||
* Encapsulated UART/USB CDC code for many drivers, for most only the init function is now available for direct acccess from the outside. Simplified main driver code and plugins using streams.
|
||||
__NOTE:__ For driver developers: `hal.stream.get_rx_buffer_available` has been renamed to `hal.stream.get_rx_buffer_free` as it was ambiguous \(free space vs. available characters\).
|
||||
* Added preview version of [Bluetooth plugin](https://github.com/grblHAL/Plugins_Bluetooth/) - allows auto configuration and auto stream switching for drivers/boards that supports it.
|
||||
* Added number of auxillary I/O ports available to `$I` command response.
|
||||
* Added value read from last `M66` to the first real-time report following the read. The element `|In:<value>` is used for the report. If the value reported is `-1` the read failed.
|
||||
|
||||
Build 20210608:
|
||||
* Fixes for `$70` setting handling, networking services. Only compile time enabled services \(or protocols\) can now be configured.
|
||||
|
||||
|
||||
@@ -30,20 +30,29 @@
|
||||
|
||||
// Compile time only default configuration
|
||||
|
||||
// Number of axes supported: minimum 3, maximum 6
|
||||
// If more than 3 axes are required a compliant driver must be provided
|
||||
//#define N_AXIS 3 // Number of axes
|
||||
#ifndef N_AXIS
|
||||
/*! Defines number of axes supported - minimum 3, maximum 6
|
||||
|
||||
// Defines compatibility level with the grbl 1.1 protocol.
|
||||
// Additional G- and M-codes are not disabled except when level is set to >= 10.
|
||||
// This does not apply to G- and M-codes dependent on driver and/or configuration settings disabled by stting level > 1.
|
||||
// Set to 0 for reporting itself as "GrblHAL" with protocol extensions enabled.
|
||||
// Set to 1 to disable some extensions, and for reporting itself as "Grbl".
|
||||
// Set to 2 to disable new settings as well, use #define parameters for setting default values.
|
||||
// These can be found in in this file and in defaults.h.
|
||||
// Set to 10 to also disable new coordinate system offsets (G59.1 - G59.3) and some $# report extensions.
|
||||
// NOTE: if switching to a level > 1 please reset non-volatile storage with $RST=* after reflashing!
|
||||
If more than 3 axes are configured a compliant driver and map file is needed.
|
||||
*/
|
||||
#define N_AXIS 3 // Number of axes
|
||||
#endif
|
||||
|
||||
#ifndef COMPATIBILITY_LEVEL
|
||||
/*! Define compatibility level with the grbl 1.1 protocol.
|
||||
|
||||
Additional G- and M-codes are not disabled except when level is set to >= 10.
|
||||
This does not apply to G- and M-codes dependent on driver and/or configuration settings disabled by setting level > 1.
|
||||
<br>Set to 0 for reporting itself as "GrblHAL" with protocol extensions enabled.
|
||||
<br>Set to 1 to disable some extensions, and for reporting itself as "Grbl".
|
||||
<br>Set to 2 to disable new settings as well, use #define parameters for setting default values.
|
||||
<br>These can be found in in this file and in defaults.h.
|
||||
<br>Set to 10 to also disable new coordinate system offsets (G59.1 - G59.3) and some $# report extensions.
|
||||
|
||||
__NOTE:__ if switching to a level > 1 please reset non-volatile storage with \a $RST=* after reflashing!
|
||||
*/
|
||||
#define COMPATIBILITY_LEVEL 0
|
||||
#endif
|
||||
|
||||
//#define KINEMATICS_API // Remove comment to add HAL entry points for custom kinematics
|
||||
|
||||
@@ -81,8 +90,11 @@
|
||||
//#define SAFETY_DOOR_SPINDLE_DELAY 4.0f // Float (seconds)
|
||||
//#define SAFETY_DOOR_COOLANT_DELAY 1.0f // Float (seconds)
|
||||
|
||||
// Control signals bit definitions and mask.
|
||||
// NOTE: these definitions are only referenced in this file. Do NOT change!
|
||||
/*! @name Control signals bit definitions and mask.
|
||||
|
||||
__NOTE:__ these definitions are only referenced in this file. Do __NOT__ change!
|
||||
*/
|
||||
///@{
|
||||
#define SIGNALS_RESET_BIT (1<<0)
|
||||
#define SIGNALS_FEEDHOLD_BIT (1<<1)
|
||||
#define SIGNALS_CYCLESTART_BIT (1<<2)
|
||||
@@ -93,7 +105,7 @@
|
||||
#define SIGNALS_PROBE_CONNECTED_BIT (1<<7)
|
||||
#define SIGNALS_MOTOR_FAULT_BIT (1<<8)
|
||||
#define SIGNALS_BITMASK (SIGNALS_RESET_BIT|SIGNALS_FEEDHOLD_BIT|SIGNALS_CYCLESTART_BIT|SIGNALS_SAFETYDOOR_BIT|SIGNALS_BLOCKDELETE_BIT|SIGNALS_STOPDISABLE_BIT|SIGNALS_ESTOP_BIT|SIGNALS_PROBE_CONNECTED_BIT|SIGNALS_MOTOR_FAULT_BIT)
|
||||
/**/
|
||||
///@}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// ADVANCED CONFIGURATION OPTIONS:
|
||||
@@ -294,7 +306,7 @@
|
||||
// override immediately after coming to a stop. However, this also means that the laser still may
|
||||
// be reenabled by disabling the spindle stop override, if needed. This is purely a safety feature
|
||||
// to ensure the laser doesn't inadvertently remain powered while at a stop and cause a fire.
|
||||
//#define DEFAULT_DISABLE_LASER_DURING_HOLD // Default enabled. Uncomment to disable.
|
||||
//#define DEFAULT_ENABLE_LASER_DURING_HOLD // Default enabled. Uncomment to disable.
|
||||
|
||||
// This option is for what should happen on resume from feed hold.
|
||||
// Default action is to restore spindle and coolant status (if overridden), this contradicts the
|
||||
@@ -356,11 +368,11 @@
|
||||
// instead of ground.
|
||||
// WARNING: When the pull-ups are disabled, this might require additional wiring with pull-down resistors!
|
||||
// Please check driver code and/or documentation.
|
||||
// #define DISABLE_LIMIT_PINS_PULL_UP_MASK AXES_BITMASK
|
||||
// #define DISABLE_LIMIT_PINS_PULL_UP_MASK (X_AXIS_BIT|Y_AXIS_BIT)
|
||||
// #define DISABLE_LIMIT_BITS_PULL_UP_MASK AXES_BITMASK
|
||||
// #define DISABLE_LIMIT_BITS_PULL_UP_MASK (X_AXIS_BIT|Y_AXIS_BIT)
|
||||
// #define DISABLE_CONTROL_PINS_PULL_UP_MASK SIGNALS_BITMASK
|
||||
// #define DISABLE_CONTROL_PINS_PULL_UP_MASK (SIGNALS_SAFETYDOOR_BIT|SIGNALS_RESET_BIT)
|
||||
// #define DISABLE_PROBE_PIN_PULL_UP
|
||||
// #define DISABLE_PROBE_BIT_PULL_UP
|
||||
|
||||
// If your machine has two limits switches wired in parallel to one axis, you will need to enable
|
||||
// this feature. Since the two switches are sharing a single pin, there is no way for Grbl to tell
|
||||
@@ -394,9 +406,9 @@
|
||||
// inverting only a few pins. See the start of this file for other signal definitions.
|
||||
// #define INVERT_CONTROL_PIN_MASK SIGNALS_BITMASK // Default disabled. Uncomment to enable.
|
||||
// #define INVERT_CONTROL_PIN_MASK (SIGNALS_SAFETYDOOR_BIT|SIGNALS_RESET_BIT) // Default disabled. Uncomment to enable.
|
||||
// #define INVERT_LIMIT_PIN_MASK AXES_BITMASK // Default disabled. Uncomment to enable. Uncomment to enable.
|
||||
// #define INVERT_LIMIT_PIN_MASK (X_AXIS_BIT|Y_AXIS_BIT) // Default disabled. Uncomment to enable.
|
||||
// For inverting the probe pin use DEFAULT_INVERT_PROBE_PIN in defaults.h
|
||||
// #define INVERT_LIMIT_BIT_MASK AXES_BITMASK // Default disabled. Uncomment to enable. Uncomment to enable.
|
||||
// #define INVERT_LIMIT_BIT_MASK (X_AXIS_BIT|Y_AXIS_BIT) // Default disabled. Uncomment to enable.
|
||||
// For inverting the probe pin use DEFAULT_INVERT_PROBE_BIT in defaults.h
|
||||
|
||||
// Inverts the spindle enable pin from low-disabled/high-enabled to low-enabled/high-disabled. Useful
|
||||
// for some pre-built electronic boards.
|
||||
@@ -496,11 +508,11 @@
|
||||
//#define DEFAULT_JUNCTION_DEVIATION 0.01f // mm
|
||||
//#define DEFAULT_ARC_TOLERANCE 0.002f // mm
|
||||
//#define DEFAULT_REPORT_INCHES
|
||||
//#define DEFAULT_INVERT_LIMIT_PINS
|
||||
//#define DEFAULT_INVERT_LIMIT_BITS
|
||||
//#define DEFAULT_SOFT_LIMIT_ENABLE
|
||||
//#define DEFAULT_JOG_LIMIT_ENABLE
|
||||
//#define DEFAULT_HARD_LIMIT_ENABLE
|
||||
//#define DEFAULT_INVERT_PROBE_PIN
|
||||
//#define DEFAULT_INVERT_PROBE_BIT
|
||||
//#define DEFAULT_LASER_MODE
|
||||
//#define DEFAULT_LATHE_MODE
|
||||
//#define DEFAULT_HOMING_ENABLE
|
||||
|
||||
+7
-10
@@ -23,17 +23,14 @@
|
||||
#define _COOLANT_CONTROL_H_
|
||||
|
||||
typedef union {
|
||||
uint8_t value;
|
||||
uint8_t mask;
|
||||
uint8_t value; //!< Bitmask value
|
||||
uint8_t mask; //!< Synonym for bitmask value
|
||||
struct {
|
||||
uint8_t flood :1,
|
||||
mist :1,
|
||||
shower :1,
|
||||
trough_spindle :1,
|
||||
reserved4 :1,
|
||||
reserved5 :1,
|
||||
reserved6 :1,
|
||||
reserved7 :1;
|
||||
uint8_t flood :1, //!< Flood coolant.
|
||||
mist :1, //!< Mist coolant, optional.
|
||||
shower :1, //!< Shower coolant, currently unused.
|
||||
trough_spindle :1, //!< Through spindle coolant, currently unused.
|
||||
unused :4;
|
||||
};
|
||||
} coolant_state_t;
|
||||
|
||||
|
||||
+9
-5
@@ -236,11 +236,15 @@ typedef enum {
|
||||
PinGroup_AuxInput = (1<<15),
|
||||
} pin_group_t;
|
||||
|
||||
//! Pin interrupt modes, may be or'ed when reporting pin capability.
|
||||
typedef enum {
|
||||
IRQ_Mode_None = 0b00,
|
||||
IRQ_Mode_Change = 0b01,
|
||||
IRQ_Mode_Rising = 0b10,
|
||||
IRQ_Mode_Falling = 0b11
|
||||
IRQ_Mode_None = 0b0000, //!< 0b0000 (0x00)
|
||||
IRQ_Mode_Rising = 0b0001, //!< 0b0001 (0x01)
|
||||
IRQ_Mode_Falling = 0b0010, //!< 0b0010 (0x02)
|
||||
IRQ_Mode_Change = 0b0011, //!< 0b0011 (0x03)
|
||||
IRQ_Mode_High = 0b0100, //!< 0b0100 (0x04)
|
||||
IRQ_Mode_Low = 0b1000, //!< 0b1000 (0x08)
|
||||
IRQ_Mode_All = 0b1111 //!< 0b1111 (0x0F) - only used to report port capability.
|
||||
} pin_irq_mode_t;
|
||||
|
||||
typedef enum {
|
||||
@@ -265,7 +269,7 @@ typedef union {
|
||||
output :1,
|
||||
open_drain :1,
|
||||
pull_mode :2,
|
||||
irq_mode :2,
|
||||
irq_mode :4,
|
||||
pwm :1,
|
||||
analog :1,
|
||||
peripheral :1,
|
||||
|
||||
+17
-17
@@ -208,9 +208,9 @@
|
||||
#define DEFAULT_ARC_TOLERANCE 0.002f
|
||||
#endif
|
||||
|
||||
#ifdef DEFAULT_INVERT_LIMIT_PINS
|
||||
#undef DEFAULT_INVERT_LIMIT_PINS
|
||||
#define INVERT_LIMIT_PIN_MASK AXES_BITMASK
|
||||
#ifdef DEFAULT_INVERT_LIMIT_BITS
|
||||
#undef DEFAULT_INVERT_LIMIT_BITS
|
||||
#define INVERT_LIMIT_BIT_MASK AXES_BITMASK
|
||||
#endif
|
||||
|
||||
#ifdef DEFAULT_REPORT_INCHES
|
||||
@@ -241,11 +241,11 @@
|
||||
#define DEFAULT_HARD_LIMIT_ENABLE 0
|
||||
#endif
|
||||
|
||||
#ifdef DEFAULT_INVERT_PROBE_PIN
|
||||
#undef DEFAULT_INVERT_PROBE_PIN
|
||||
#define DEFAULT_INVERT_PROBE_PIN 1
|
||||
#ifdef DEFAULT_INVERT_PROBE_BIT
|
||||
#undef DEFAULT_INVERT_PROBE_BIT
|
||||
#define DEFAULT_INVERT_PROBE_BIT 1
|
||||
#else
|
||||
#define DEFAULT_INVERT_PROBE_PIN 0
|
||||
#define DEFAULT_INVERT_PROBE_BIT 0
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_A_STEPS_PER_MM
|
||||
@@ -359,11 +359,11 @@
|
||||
#define DEFAULT_SLEEP_ENABLE 0
|
||||
#endif
|
||||
|
||||
#ifdef DEFAULT_DISABLE_LASER_DURING_HOLD
|
||||
#undef DEFAULT_DISABLE_LASER_DURING_HOLD
|
||||
#define DEFAULT_DISABLE_LASER_DURING_HOLD 0
|
||||
#ifdef DEFAULT_ENABLE_LASER_DURING_HOLD
|
||||
#undef DEFAULT_ENABLE_LASER_DURING_HOLD
|
||||
#define DEFAULT_ENABLE_LASER_DURING_HOLD 0
|
||||
#else
|
||||
#define DEFAULT_DISABLE_LASER_DURING_HOLD 1
|
||||
#define DEFAULT_ENABLE_LASER_DURING_HOLD 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -561,8 +561,8 @@
|
||||
#define INVERT_ST_ENABLE_MASK 0
|
||||
#endif
|
||||
|
||||
#ifndef INVERT_LIMIT_PIN_MASK
|
||||
#define INVERT_LIMIT_PIN_MASK 0
|
||||
#ifndef INVERT_LIMIT_BIT_MASK
|
||||
#define INVERT_LIMIT_BIT_MASK 0
|
||||
#endif
|
||||
|
||||
#ifndef INVERT_CONTROL_PIN_MASK
|
||||
@@ -581,12 +581,12 @@
|
||||
#define INVERT_SPINDLE_PWM_PIN 0
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_LIMIT_PINS_PULL_UP_MASK
|
||||
#define DISABLE_LIMIT_PINS_PULL_UP_MASK 0
|
||||
#ifndef DISABLE_LIMIT_BITS_PULL_UP_MASK
|
||||
#define DISABLE_LIMIT_BITS_PULL_UP_MASK 0
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_PROBE_PIN_PULL_UP
|
||||
#define DISABLE_PROBE_PIN_PULL_UP 0
|
||||
#ifndef DISABLE_PROBE_BIT_PULL_UP
|
||||
#define DISABLE_PROBE_BIT_PULL_UP 0
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_CONTROL_PINS_PULL_UP_MASK
|
||||
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
driver_opts.h - for preprocessing options from my_machine.h or compiler symbols
|
||||
|
||||
NOTE: This file is not used by the core, it may be used by drivers
|
||||
|
||||
Part of grblHAL
|
||||
|
||||
Copyright (c) 2020-2021 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
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Grbl is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
//
|
||||
// NOTE: do NOT change options here - edit the driver specific my_machine.h instead!
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "hal.h"
|
||||
#include "nuts_bolts.h"
|
||||
|
||||
#ifndef X_GANGED
|
||||
#define X_GANGED 0
|
||||
#endif
|
||||
#ifndef X_AUTO_SQUARE
|
||||
#define X_AUTO_SQUARE 0
|
||||
#endif
|
||||
#ifndef Y_GANGED
|
||||
#define Y_GANGED 0
|
||||
#endif
|
||||
#ifndef Y_AUTO_SQUARE
|
||||
#define Y_AUTO_SQUARE 0
|
||||
#endif
|
||||
#ifndef Z_GANGED
|
||||
#define Z_GANGED 0
|
||||
#endif
|
||||
#ifndef Z_AUTO_SQUARE
|
||||
#define Z_AUTO_SQUARE 0
|
||||
#endif
|
||||
#ifndef X_GANGED_LIM_MAX
|
||||
#define X_GANGED_LIM_MAX 0
|
||||
#endif
|
||||
#ifndef Y_GANGED_LIM_MAX
|
||||
#define Y_GANGED_LIM_MAX 0
|
||||
#endif
|
||||
#ifndef Z_GANGED_LIM_MAX
|
||||
#define Z_GANGED_LIM_MAX 0
|
||||
#endif
|
||||
|
||||
#if X_AUTO_SQUARE && !X_GANGED
|
||||
#undef X_GANGED
|
||||
#define X_GANGED 1
|
||||
#endif
|
||||
#if Y_AUTO_SQUARE && !Y_GANGED
|
||||
#undef Y_GANGED
|
||||
#define Y_GANGED 1
|
||||
#endif
|
||||
#if Z_AUTO_SQUARE && !Z_GANGED
|
||||
#undef Z_GANGED
|
||||
#define Z_GANGED 1
|
||||
#endif
|
||||
|
||||
#define N_GANGED (X_GANGED + Y_GANGED + Z_GANGED)
|
||||
#define N_AUTO_SQUARED (X_AUTO_SQUARE + Y_AUTO_SQUARE + Z_AUTO_SQUARE)
|
||||
#define N_ABC_MOTORS (N_ABC_AXIS + N_GANGED)
|
||||
|
||||
#ifndef USB_SERIAL_CDC
|
||||
#define USB_SERIAL_CDC 0 // for UART comms
|
||||
#endif
|
||||
#ifndef USB_SERIAL_WAIT
|
||||
#define USB_SERIAL_WAIT 0
|
||||
#endif
|
||||
#ifndef SDCARD_ENABLE
|
||||
#define SDCARD_ENABLE 0
|
||||
#endif
|
||||
#ifndef KEYPAD_ENABLE
|
||||
#define KEYPAD_ENABLE 0
|
||||
#endif
|
||||
#ifndef EEPROM_ENABLE
|
||||
#define EEPROM_ENABLE 0
|
||||
#endif
|
||||
#ifndef EEPROM_IS_FRAM
|
||||
#define EEPROM_IS_FRAM 0
|
||||
#endif
|
||||
#ifndef SPINDLE_SYNC_ENABLE
|
||||
#define SPINDLE_SYNC_ENABLE 0
|
||||
#endif
|
||||
#ifndef TRINAMIC_ENABLE
|
||||
#define TRINAMIC_ENABLE 0
|
||||
#endif
|
||||
#ifndef TRINAMIC_I2C
|
||||
#define TRINAMIC_I2C 0
|
||||
#endif
|
||||
#ifndef TRINAMIC_DEV
|
||||
#define TRINAMIC_DEV 0
|
||||
#endif
|
||||
#ifndef PWM_RAMPED
|
||||
#define PWM_RAMPED 0
|
||||
#endif
|
||||
#ifndef PLASMA_ENABLE
|
||||
#define PLASMA_ENABLE 0
|
||||
#endif
|
||||
#ifndef PPI_ENABLE
|
||||
#define PPI_ENABLE 0
|
||||
#endif
|
||||
#ifndef SPINDLE_HUANYANG
|
||||
#define SPINDLE_HUANYANG 0
|
||||
#endif
|
||||
#ifndef QEI_ENABLE
|
||||
#define QEI_ENABLE 0
|
||||
#endif
|
||||
#ifndef ODOMETER_ENABLE
|
||||
#define ODOMETER_ENABLE 0
|
||||
#endif
|
||||
#ifndef BLUETOOTH_ENABLE
|
||||
#define BLUETOOTH_ENABLE 0
|
||||
#endif
|
||||
#ifndef OPENPNP_ENABLE
|
||||
#define OPENPNP_ENABLE 0
|
||||
#endif
|
||||
#ifndef LIMITS_OVERRIDE_ENABLE
|
||||
#define LIMITS_OVERRIDE_ENABLE 0
|
||||
#endif
|
||||
|
||||
#ifndef ESTOP_ENABLE
|
||||
#if COMPATIBILITY_LEVEL <= 1
|
||||
#define ESTOP_ENABLE 1
|
||||
#else
|
||||
#define ESTOP_ENABLE 0
|
||||
#endif
|
||||
#elif ESTOP_ENABLE && COMPATIBILITY_LEVEL > 1
|
||||
#warning "Enabling ESTOP may not work with all senders!"
|
||||
#endif
|
||||
|
||||
#ifndef ETHERNET_ENABLE
|
||||
#define ETHERNET_ENABLE 0
|
||||
#endif
|
||||
#ifndef TELNET_ENABLE
|
||||
#define TELNET_ENABLE 0
|
||||
#endif
|
||||
#ifndef WEBSOCKET_ENABLE
|
||||
#define WEBSOCKET_ENABLE 0
|
||||
#endif
|
||||
#ifndef FTP_ENABLE
|
||||
#define FTP_ENABLE 0
|
||||
#elif !SDCARD_ENABLE
|
||||
#undef FTP_ENABLE
|
||||
#define FTP_ENABLE 0
|
||||
#endif
|
||||
|
||||
#if ETHERNET_ENABLE
|
||||
#ifndef NETWORK_HOSTNAME
|
||||
#define NETWORK_HOSTNAME "GRBL"
|
||||
#endif
|
||||
#ifndef NETWORK_IPMODE
|
||||
#define NETWORK_IPMODE 1 // 0 = static, 1 = DHCP, 2 = AutoIP
|
||||
#endif
|
||||
#ifndef NETWORK_IP
|
||||
#define NETWORK_IP "192.168.5.1"
|
||||
#endif
|
||||
#ifndef NETWORK_GATEWAY
|
||||
#define NETWORK_GATEWAY "192.168.5.1"
|
||||
#endif
|
||||
#ifndef NETWORK_MASK
|
||||
#define NETWORK_MASK "255.255.255.0"
|
||||
#endif
|
||||
#ifndef NETWORK_TELNET_PORT
|
||||
#define NETWORK_TELNET_PORT 23
|
||||
#endif
|
||||
#ifndef NETWORK_WEBSOCKET_PORT
|
||||
#define NETWORK_WEBSOCKET_PORT 80
|
||||
#endif
|
||||
#ifndef NETWORK_HTTP_PORT
|
||||
#define NETWORK_HTTP_PORT 80
|
||||
#endif
|
||||
#if NETWORK_IPMODE < 0 || NETWORK_IPMODE > 2
|
||||
#error "Invalid IP mode selected!"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*EOF*/
|
||||
@@ -34,7 +34,7 @@
|
||||
#else
|
||||
#define GRBL_VERSION "1.1f"
|
||||
#endif
|
||||
#define GRBL_VERSION_BUILD "20210608"
|
||||
#define GRBL_VERSION_BUILD "20210626"
|
||||
|
||||
// The following symbols are set here if not already set by the compiler or in config.h
|
||||
// Do NOT change here!
|
||||
@@ -43,10 +43,10 @@
|
||||
#include "esp_attr.h"
|
||||
#define ISR_CODE IRAM_ATTR
|
||||
#else
|
||||
//#define ISR_CODE __attribute__((long_call, section(".data")))
|
||||
// #define ISR_CODE __attribute__((long_call, section(".data")))
|
||||
// Used to decorate code run in interrupt context.
|
||||
// Do not remove or change unless you know what you are doing.
|
||||
#define ISR_CODE
|
||||
#define ISR_CODE //!< Used by some drivers to force a function to always stay in RAM to improve performance.
|
||||
#endif
|
||||
|
||||
#ifdef ARDUINO
|
||||
@@ -57,14 +57,6 @@
|
||||
#define PROGMEM
|
||||
#endif
|
||||
|
||||
#ifndef N_AXIS
|
||||
#define N_AXIS 3 // Number of axes
|
||||
#endif
|
||||
|
||||
#ifndef COMPATIBILITY_LEVEL
|
||||
#define COMPATIBILITY_LEVEL 0
|
||||
#endif
|
||||
|
||||
#if (defined(COREXY) || defined(WALL_PLOTTER) || defined(MASLOW_ROUTER)) && !defined(KINEMATICS_API)
|
||||
#define KINEMATICS_API
|
||||
#endif
|
||||
|
||||
@@ -49,8 +49,7 @@
|
||||
#include "wall_plotter.h"
|
||||
#endif
|
||||
|
||||
// Declare system global variable structure
|
||||
system_t sys = {0};
|
||||
struct system sys = {0}; //!< System global variable structure.
|
||||
grbl_t grbl;
|
||||
grbl_hal_t hal;
|
||||
|
||||
@@ -229,6 +228,7 @@ int grbl_enter (void)
|
||||
else
|
||||
memset(&sys, 0, offsetof(system_t, alarm)); // Clear system variables except state & alarm.
|
||||
|
||||
sys.var5933 = -2; // Clear last M66 result
|
||||
sys.override.feed_rate = DEFAULT_FEED_OVERRIDE; // Set to 100%
|
||||
sys.override.rapid_rate = DEFAULT_RAPID_OVERRIDE; // Set to 100%
|
||||
sys.override.spindle_rpm = DEFAULT_SPINDLE_RPM_OVERRIDE; // Set to 100%
|
||||
|
||||
+1
-1
@@ -770,7 +770,7 @@ status_code_t mc_homing_cycle (axes_signals_t cycle)
|
||||
|
||||
// Check and abort homing cycle, if hard limits are already enabled. Helps prevent problems
|
||||
// with machines with limits wired on both ends of travel to one limit pin.
|
||||
// TODO: Move the pin-specific LIMIT_PIN call to limits.c as a function.
|
||||
// TODO: Move the pin-specific LIMIT_BIT call to limits.c as a function.
|
||||
if (settings.limits.flags.two_switches && hal.homing.get_state == hal.limits.get_state && limit_signals_merge(hal.limits.get_state()).value) {
|
||||
mc_reset(); // Issue system reset and ensure spindle and coolant are shutdown.
|
||||
system_set_exec_alarm(Alarm_HardLimit);
|
||||
|
||||
+607
File diff suppressed because it is too large
Load Diff
+15
-4
@@ -95,6 +95,16 @@
|
||||
#define AXES_BITMASK (X_AXIS_BIT|Y_AXIS_BIT|Z_AXIS_BIT|A_AXIS_BIT|B_AXIS_BIT|C_AXIS_BIT|U_AXIS_BIT|V_AXIS_BIT)
|
||||
#endif
|
||||
|
||||
#ifdef C_AXIS
|
||||
#define N_ABC_AXIS 3
|
||||
#elif defined(B_AXIS)
|
||||
#define N_ABC_AXIS 2
|
||||
#elif defined(A_AXIS)
|
||||
#define N_ABC_AXIS 1
|
||||
#else
|
||||
#define N_ABC_AXIS 0
|
||||
#endif
|
||||
|
||||
extern char const *const axis_letter[];
|
||||
|
||||
typedef union {
|
||||
@@ -114,11 +124,12 @@ typedef union {
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
//! \brief Limit switches struct, consists of four packed axes_signals_t structs.
|
||||
typedef struct {
|
||||
axes_signals_t min;
|
||||
axes_signals_t max;
|
||||
axes_signals_t min2;
|
||||
axes_signals_t max2;
|
||||
axes_signals_t min; //!< Min limit switches status, required.
|
||||
axes_signals_t max; //!< Max limit switches status, optional.
|
||||
axes_signals_t min2; //!< Secondary min limit switch(es) status, required for auto squaring enabled axes.
|
||||
axes_signals_t max2; //!< Secondary max limit switches status, optional (of no practical use?).
|
||||
} limit_signals_t;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -24,16 +24,27 @@
|
||||
#define _NVS_H_
|
||||
|
||||
#ifndef NVS_SIZE
|
||||
/*! \brief Total size in bytes of the NVS.
|
||||
Minimum 1024 bytes required, more if space for driver and/or plugin data and settings is required.
|
||||
*/
|
||||
#define NVS_SIZE 2048
|
||||
#endif
|
||||
|
||||
/*! \brief Number of bytes at the start of the NVS area reserved for core settings and parameters.
|
||||
Minimum 1024 bytes required.
|
||||
*/
|
||||
#define GRBL_NVS_SIZE 1024
|
||||
|
||||
//! Number of bytes used for storing CRC values. Do not change this!
|
||||
#define NVS_CRC_BYTES 1
|
||||
|
||||
// Define persistent storage memory address location values for Grbl settings and parameters
|
||||
// NOTE: 1KB persistent storage is the minimum required. The upper half is reserved for parameters and
|
||||
// the startup script. The lower half contains the global settings and space for future
|
||||
// developments.
|
||||
/*! @name Define persistent storage memory address location values for core settings and parameters.
|
||||
The upper half is reserved for parameters and the startup script.
|
||||
The lower half contains the global settings and space for future developments.
|
||||
|
||||
__NOTE:__ 1024 bytes of persistent storage is the minimum required.
|
||||
*/
|
||||
///@{
|
||||
#define NVS_ADDR_GLOBAL 1U
|
||||
#define NVS_ADDR_PARAMETERS 512U
|
||||
#define NVS_ADDR_BUILD_INFO 942U
|
||||
@@ -41,37 +52,88 @@
|
||||
#ifdef N_TOOLS
|
||||
#define NVS_ADDR_TOOL_TABLE (NVS_ADDR_PARAMETERS - 1 - N_TOOLS * (sizeof(tool_data_t) + NVS_CRC_BYTES))
|
||||
#endif
|
||||
///@}
|
||||
|
||||
typedef enum {
|
||||
NVS_None = 0,
|
||||
NVS_EEPROM,
|
||||
NVS_FRAM,
|
||||
NVS_Flash,
|
||||
NVS_Emulated
|
||||
NVS_None = 0, //!< 0
|
||||
NVS_EEPROM, //!< 1
|
||||
NVS_FRAM, //!< 2
|
||||
NVS_Flash, //!< 3
|
||||
NVS_Emulated //!< 4 - used by the core for buffered read and write
|
||||
} nvs_type;
|
||||
|
||||
//! Structure for keeping track of NVS area used by driver and/or plugin code.
|
||||
typedef struct {
|
||||
uint8_t *mem_address;
|
||||
uint16_t address;
|
||||
uint16_t size;
|
||||
uint8_t *mem_address; //!< Pointer to location in RAM where driver area is located.
|
||||
uint16_t address; //!< Index based address into the storage area where the driver area starts.
|
||||
uint16_t size; //!< Actual size of driver area in bytes.
|
||||
} nvs_driver_area_t;
|
||||
|
||||
typedef enum {
|
||||
NVS_TransferResult_Failed = 0,
|
||||
NVS_TransferResult_Busy,
|
||||
NVS_TransferResult_OK,
|
||||
NVS_TransferResult_Failed = 0, //!< 0
|
||||
NVS_TransferResult_Busy, //!< 1
|
||||
NVS_TransferResult_OK, //!< 2
|
||||
} nvs_transfer_result_t;
|
||||
|
||||
/*! \brief Pointer to function for getting a byte from NVS storage.
|
||||
\param addr index base address into the area.
|
||||
\returns byte read.
|
||||
*/
|
||||
typedef uint8_t (*get_byte_ptr)(uint32_t addr);
|
||||
|
||||
/*! \brief Pointer to function for putting a byte into NVS storage.
|
||||
\param addr index based address into the storage area.
|
||||
\param new_value byte to write.
|
||||
*/
|
||||
typedef void (*put_byte_ptr)(uint32_t addr, uint8_t new_value);
|
||||
|
||||
/*! \brief Pointer to function for reading a block of data from NVS storage
|
||||
\param dest pointer to destination of data.
|
||||
\param source index based address into the storage area.
|
||||
\param number of bytes to write.
|
||||
\param with_checksum \a true calculate and verify checksum at the end of the data block, \a false do not calculate and verify checksum.
|
||||
\returns #nvs_transfer_result_t enum.
|
||||
*/
|
||||
typedef nvs_transfer_result_t (*memcpy_from_nvs_ptr)(uint8_t *dest, uint32_t source, uint32_t size, bool with_checksum);
|
||||
|
||||
/*! \brief Pointer to function for writing a block of data to NVS storage
|
||||
\param dest index based address into the storage area.
|
||||
\param source pointer to source data
|
||||
\param number of bytes to write
|
||||
\param with_checksum \a true calculate and add a checksum at the end of the data block, \a false do not add checksum.
|
||||
\returns #nvs_transfer_result_t enum.
|
||||
*/
|
||||
typedef nvs_transfer_result_t (*memcpy_to_nvs_ptr)(uint32_t dest, uint8_t *source, uint32_t size, bool with_checksum);
|
||||
|
||||
/*! \brief Pointer to function for reading a block of data from flash based NVS storage.
|
||||
\param dest pointer to destination of data.
|
||||
\returns true if successful, false otherwise.
|
||||
*/
|
||||
typedef bool (*memcpy_from_flash_ptr)(uint8_t *dest);
|
||||
|
||||
/*! \brief Pointer to function for reading a block of data from flash based NVS storage.
|
||||
\param source pointer to source data.
|
||||
\returns true if successful, false otherwise.
|
||||
*/
|
||||
typedef bool (*memcpy_to_flash_ptr)(uint8_t *source);
|
||||
|
||||
//! \brief Handler functions and variables for NVS storage of settings and data.
|
||||
typedef struct {
|
||||
nvs_type type;
|
||||
uint16_t size;
|
||||
nvs_type type; //!< Type of NVS storage.
|
||||
uint16_t size; //!< Actual size of non-volatile storage area.
|
||||
nvs_driver_area_t driver_area;
|
||||
uint8_t (*get_byte)(uint32_t addr);
|
||||
void (*put_byte)(uint32_t addr, uint8_t new_value);
|
||||
nvs_transfer_result_t (*memcpy_to_nvs)(uint32_t destination, uint8_t *source, uint32_t size, bool with_checksum);
|
||||
nvs_transfer_result_t (*memcpy_from_nvs)(uint8_t *destination, uint32_t source, uint32_t size, bool with_checksum);
|
||||
bool (*memcpy_from_flash)(uint8_t *dest);
|
||||
bool (*memcpy_to_flash)(uint8_t *source);
|
||||
//! @name Handler functions for EEPROM or FRAM based storage.
|
||||
//@{
|
||||
get_byte_ptr get_byte; //!< Handler for reading a byte from EEPROM or FRAM.
|
||||
put_byte_ptr put_byte; //!< Handler for writing a byte to EEPROM or FRAM.
|
||||
memcpy_to_nvs_ptr memcpy_to_nvs; //!< Handler for reading a block of data from EEPROM or FRAM.
|
||||
memcpy_from_nvs_ptr memcpy_from_nvs; //!< Handler for writing a block of data to EEPROM or FRAM.
|
||||
//@}
|
||||
//! @name Handler functions for Flash based storage.
|
||||
//@{
|
||||
memcpy_from_flash_ptr memcpy_from_flash; //!< Handler for reading a block of data from flash.
|
||||
memcpy_to_flash_ptr memcpy_to_flash; //!< Handler for writing a block of data to flash.
|
||||
//@}
|
||||
} nvs_io_t;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -54,7 +54,7 @@ typedef struct plan_block {
|
||||
// NOTE: Used by stepper algorithm to execute the block correctly. Do not alter these values.
|
||||
uint32_t steps[N_AXIS]; // Step count along each axis
|
||||
uint32_t step_event_count; // The maximum step axis count and number of steps required to complete this block.
|
||||
axes_signals_t direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
|
||||
axes_signals_t direction_bits; // The direction bit set for this block (refers to *_DIRECTION_PIN in config.h)
|
||||
|
||||
// Block condition data to ensure correct execution depending on states and overrides.
|
||||
planner_cond_t condition; // Block bitfield variable defining block run conditions. Copied from pl_line_data.
|
||||
|
||||
@@ -130,8 +130,8 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
Setting_EncoderMode = 0,
|
||||
Setting_EncoderCPR = 1, // Count Per Revolution
|
||||
Setting_EncoderCPD = 2, // Count Per Detent
|
||||
Setting_EncoderCPR = 1, //!< Count Per Revolution.
|
||||
Setting_EncoderCPD = 2, //!< Count Per Detent.
|
||||
Setting_EncoderDblClickWindow = 3 // ms
|
||||
} encoder_setting_id_t;
|
||||
|
||||
@@ -156,16 +156,16 @@ typedef union {
|
||||
|
||||
typedef struct {
|
||||
encoder_mode_t mode;
|
||||
uint32_t cpr; // count per revolution
|
||||
uint32_t cpd; // count per detent
|
||||
uint32_t dbl_click_window; // ms
|
||||
uint32_t cpr; //!< Count per revolution.
|
||||
uint32_t cpd; //!< Count per detent.
|
||||
uint32_t dbl_click_window; //!< ms.
|
||||
encoder_flags_t flags;
|
||||
} encoder_settings_t;
|
||||
|
||||
typedef struct {
|
||||
encoder_mode_t mode;
|
||||
uint_fast8_t id;
|
||||
uint_fast8_t axis; // axis index for MPG encoders, 0xFF for others
|
||||
uint_fast8_t axis; //!< Axis index for MPG encoders, 0xFF for others.
|
||||
int32_t position;
|
||||
uint32_t velocity;
|
||||
encoder_event_t event;
|
||||
|
||||
@@ -25,17 +25,17 @@
|
||||
// Values that define the probing state machine.
|
||||
|
||||
typedef enum {
|
||||
Probing_Off = 0,
|
||||
Probing_Active
|
||||
Probing_Off = 0, //!< 0
|
||||
Probing_Active //!< 0
|
||||
} probing_state_t;
|
||||
|
||||
typedef union {
|
||||
uint8_t value;
|
||||
struct {
|
||||
uint8_t triggered :1,
|
||||
connected :1,
|
||||
inverted :1, // For driver use
|
||||
is_probing :1, // For driver use
|
||||
uint8_t triggered :1, //<! Set to true when probe is triggered.
|
||||
connected :1, //<! Set to true when probe is connected. Always set to true if the driver does not have a probe connected input.
|
||||
inverted :1, //<! For driver use
|
||||
is_probing :1, //<! For driver use
|
||||
unassigned :4;
|
||||
};
|
||||
} probe_state_t;
|
||||
|
||||
+3
-2
@@ -398,7 +398,7 @@ bool protocol_execute_realtime (void)
|
||||
// NOTE: Do not alter this unless you know exactly what you are doing!
|
||||
bool protocol_exec_rt_system (void)
|
||||
{
|
||||
uint_fast16_t rt_exec;
|
||||
rt_exec_t rt_exec;
|
||||
bool killed = false;
|
||||
|
||||
if (sys.rt_exec_alarm && (rt_exec = system_clear_exec_alarm())) { // Enter only if any bit flag is true
|
||||
@@ -758,8 +758,9 @@ ISR_CODE bool protocol_enqueue_realtime_command (char c)
|
||||
case CMD_STATUS_REPORT_ALL: // Add all statuses on to report
|
||||
{
|
||||
bool tlo = sys.report.tool_offset;
|
||||
sys.report.value = (uint16_t)-1;
|
||||
sys.report.value = (uint32_t)-1;
|
||||
sys.report.tool_offset = tlo;
|
||||
sys.report.m66result = sys.var5933 > -2;
|
||||
}
|
||||
// no break
|
||||
|
||||
|
||||
@@ -1079,6 +1079,18 @@ void report_build_info (char *line, bool extended)
|
||||
hal.stream.write("]" ASCII_EOL);
|
||||
#endif
|
||||
|
||||
if(hal.port.num_digital_in + hal.port.num_digital_out + hal.port.num_analog_in + hal.port.num_analog_out > 0) {
|
||||
hal.stream.write("[AUX IO:");
|
||||
hal.stream.write(uitoa(hal.port.num_digital_in));
|
||||
hal.stream.write(",");
|
||||
hal.stream.write(uitoa(hal.port.num_digital_out));
|
||||
hal.stream.write(",");
|
||||
hal.stream.write(uitoa(hal.port.num_analog_in));
|
||||
hal.stream.write(",");
|
||||
hal.stream.write(uitoa(hal.port.num_analog_out));
|
||||
hal.stream.write("]" ASCII_EOL);
|
||||
}
|
||||
|
||||
grbl.on_report_options(false);
|
||||
}
|
||||
}
|
||||
@@ -1197,7 +1209,7 @@ void report_realtime_status (void)
|
||||
hal.stream.write_all("|Bf:");
|
||||
hal.stream.write_all(uitoa((uint32_t)plan_get_block_buffer_available()));
|
||||
hal.stream.write_all(",");
|
||||
hal.stream.write_all(uitoa(hal.stream.get_rx_buffer_available()));
|
||||
hal.stream.write_all(uitoa(hal.stream.get_rx_buffer_free()));
|
||||
}
|
||||
|
||||
if(settings.status_report.line_numbers) {
|
||||
@@ -1346,6 +1358,13 @@ void report_realtime_status (void)
|
||||
|
||||
if(sys.report.tlo_reference)
|
||||
hal.stream.write_all(appendbuf(2, "|TLR:", uitoa(sys.tlo_reference_set.mask != 0)));
|
||||
|
||||
if(sys.report.m66result && sys.var5933 > -2) { // M66 result
|
||||
if(sys.var5933 >= 0)
|
||||
hal.stream.write_all(appendbuf(2, "|In:", uitoa(sys.var5933)));
|
||||
else
|
||||
hal.stream.write_all("|In:-1");
|
||||
}
|
||||
}
|
||||
|
||||
if(grbl.on_realtime_report)
|
||||
|
||||
+54
-65
@@ -79,7 +79,7 @@ PROGMEM const settings_t defaults = {
|
||||
.flags.sleep_enable = DEFAULT_SLEEP_ENABLE,
|
||||
#if DEFAULT_LASER_MODE
|
||||
.mode = Mode_Laser,
|
||||
.flags.disable_laser_during_hold = DEFAULT_DISABLE_LASER_DURING_HOLD,
|
||||
.flags.disable_laser_during_hold = DEFAULT_ENABLE_LASER_DURING_HOLD,
|
||||
#else
|
||||
.flags.disable_laser_during_hold = 0,
|
||||
#if DEFAULT_LATHE_MODE
|
||||
@@ -89,9 +89,9 @@ PROGMEM const settings_t defaults = {
|
||||
.flags.restore_after_feed_hold = DEFAULT_RESTORE_AFTER_FEED_HOLD,
|
||||
.flags.force_initialization_alarm = DEFAULT_FORCE_INITIALIZATION_ALARM,
|
||||
|
||||
.probe.disable_probe_pullup = DISABLE_PROBE_PIN_PULL_UP,
|
||||
.probe.disable_probe_pullup = DISABLE_PROBE_BIT_PULL_UP,
|
||||
.probe.allow_feed_override = ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES,
|
||||
.probe.invert_probe_pin = DEFAULT_INVERT_PROBE_PIN,
|
||||
.probe.invert_probe_pin = DEFAULT_INVERT_PROBE_BIT,
|
||||
|
||||
.steppers.pulse_microseconds = DEFAULT_STEP_PULSE_MICROSECONDS,
|
||||
.steppers.pulse_delay_microseconds = DEFAULT_STEP_PULSE_DELAY,
|
||||
@@ -141,8 +141,8 @@ PROGMEM const settings_t defaults = {
|
||||
.limits.flags.jog_soft_limited = DEFAULT_JOG_LIMIT_ENABLE,
|
||||
.limits.flags.check_at_init = DEFAULT_CHECK_LIMITS_AT_INIT,
|
||||
.limits.flags.two_switches = DEFAULT_LIMITS_TWO_SWITCHES_ON_AXES,
|
||||
.limits.invert.mask = INVERT_LIMIT_PIN_MASK,
|
||||
.limits.disable_pullup.mask = DISABLE_LIMIT_PINS_PULL_UP_MASK,
|
||||
.limits.invert.mask = INVERT_LIMIT_BIT_MASK,
|
||||
.limits.disable_pullup.mask = DISABLE_LIMIT_BITS_PULL_UP_MASK,
|
||||
|
||||
.control_invert.mask = INVERT_CONTROL_PIN_MASK,
|
||||
.control_disable_pullup.mask = DISABLE_CONTROL_PINS_PULL_UP_MASK,
|
||||
@@ -355,8 +355,8 @@ static uint32_t get_int (setting_id_t id);
|
||||
static bool is_setting_available (const setting_detail_t *setting);
|
||||
|
||||
static char control_signals[] = "Reset,Feed hold,Cycle start,Safety door,Block delete,Optional stop,EStop,Probe connected,Motor fault";
|
||||
static char control_signals_map[] = "0,1,2,3,4,5,6,7,8";
|
||||
static char spindle_signals[] = "Spindle enable,Spindle direction,PWM";
|
||||
static char coolant_signals[] = "Flood,Mist";
|
||||
|
||||
PROGMEM static const setting_detail_t setting_detail[] = {
|
||||
{ Setting_PulseMicroseconds, Group_Stepper, "Step pulse time", "microseconds", Format_Decimal, "#0.0", "2.0", NULL, Setting_IsLegacy, &settings.steppers.pulse_microseconds, NULL, NULL },
|
||||
@@ -380,10 +380,10 @@ PROGMEM static const setting_detail_t setting_detail[] = {
|
||||
{ Setting_JunctionDeviation, Group_General, "Junction deviation", "mm", Format_Decimal, "#####0.000", NULL, NULL, Setting_IsLegacy, &settings.junction_deviation, NULL, NULL },
|
||||
{ Setting_ArcTolerance, Group_General, "Arc tolerance", "mm", Format_Decimal, "#####0.000", NULL, NULL, Setting_IsLegacy, &settings.arc_tolerance, NULL, NULL },
|
||||
{ Setting_ReportInches, Group_General, "Report in inches", NULL, Format_Bool, NULL, NULL, NULL, Setting_IsLegacyFn, set_report_inches, get_int, NULL },
|
||||
{ Setting_ControlInvertMask, Group_ControlSignals, "Invert control pins", NULL, Format_Bitfield, control_signals, control_signals_map, NULL, Setting_IsExpandedFn, set_control_invert, get_int, NULL },
|
||||
{ Setting_CoolantInvertMask, Group_Coolant, "Invert coolant pins", NULL, Format_Bitfield, "Flood,Mist", NULL, NULL, Setting_IsExtended, &settings.coolant_invert.mask, NULL, NULL },
|
||||
{ Setting_ControlInvertMask, Group_ControlSignals, "Invert control pins", NULL, Format_Bitfield, control_signals, NULL, NULL, Setting_IsExpandedFn, set_control_invert, get_int, NULL },
|
||||
{ Setting_CoolantInvertMask, Group_Coolant, "Invert coolant pins", NULL, Format_Bitfield, coolant_signals, NULL, NULL, Setting_IsExtended, &settings.coolant_invert.mask, NULL, NULL },
|
||||
{ Setting_SpindleInvertMask, Group_Spindle, "Invert spindle signals", NULL, Format_Bitfield, spindle_signals, NULL, NULL, Setting_IsExtendedFn, set_spindle_invert, get_int, NULL },
|
||||
{ Setting_ControlPullUpDisableMask, Group_ControlSignals, "Pullup disable control pins", NULL, Format_Bitfield, control_signals, control_signals_map, NULL, Setting_IsExtendedFn, set_control_disable_pullup, get_int, NULL },
|
||||
{ Setting_ControlPullUpDisableMask, Group_ControlSignals, "Pullup disable control pins", NULL, Format_Bitfield, control_signals, NULL, NULL, Setting_IsExtendedFn, set_control_disable_pullup, get_int, NULL },
|
||||
{ Setting_LimitPullUpDisableMask, Group_Limits, "Pullup disable limit pins", NULL, Format_AxisMask, NULL, NULL, NULL, Setting_IsExtended, &settings.limits.disable_pullup.mask, NULL, NULL },
|
||||
{ Setting_ProbePullUpDisable, Group_Probing, "Pullup disable probe pin", NULL, Format_Bool, NULL, NULL, NULL, Setting_IsExtendedFn, set_probe_disable_pullup, get_int, NULL },
|
||||
{ Setting_SoftLimitsEnable, Group_Limits, "Soft limits enable", NULL, Format_Bool, NULL, NULL, NULL, Setting_IsLegacyFn, set_soft_limits_enable, get_int, NULL },
|
||||
@@ -547,7 +547,7 @@ setting_details_t *settings_get_details (void)
|
||||
#if COMPATIBILITY_LEVEL > 1
|
||||
static status_code_t set_limits_invert_mask (setting_id_t id, uint_fast16_t int_value)
|
||||
{
|
||||
settings.limits.invert.mask = (int_value ? ~(INVERT_LIMIT_PIN_MASK) : INVERT_LIMIT_PIN_MASK) & AXES_BITMASK;
|
||||
settings.limits.invert.mask = (int_value ? ~(INVERT_LIMIT_BIT_MASK) : INVERT_LIMIT_BIT_MASK) & AXES_BITMASK;
|
||||
|
||||
return Status_OK;
|
||||
}
|
||||
@@ -700,7 +700,7 @@ static status_code_t set_mode (setting_id_t id, uint_fast16_t int_value)
|
||||
if(!hal.driver_cap.variable_spindle)
|
||||
return Status_SettingDisabledLaser;
|
||||
if(settings.mode != Mode_Laser)
|
||||
settings.flags.disable_laser_during_hold = DEFAULT_DISABLE_LASER_DURING_HOLD;
|
||||
settings.flags.disable_laser_during_hold = DEFAULT_ENABLE_LASER_DURING_HOLD;
|
||||
gc_state.modal.diameter_mode = false;
|
||||
break;
|
||||
|
||||
@@ -967,7 +967,7 @@ static uint32_t get_int (setting_id_t id)
|
||||
|
||||
#if COMPATIBILITY_LEVEL > 1
|
||||
case Setting_LimitPinsInvertMask:
|
||||
value = settings.limits.invert.mask == INVERT_LIMIT_PIN_MASK ? 0 : 1;
|
||||
value = settings.limits.invert.mask == INVERT_LIMIT_BIT_MASK ? 0 : 1;
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -992,7 +992,7 @@ static uint32_t get_int (setting_id_t id)
|
||||
break;
|
||||
|
||||
case Setting_ControlInvertMask:
|
||||
value = settings.control_invert.mask;
|
||||
value = settings.control_invert.mask & hal.signals_cap.mask;
|
||||
break;
|
||||
|
||||
case Setting_SpindleInvertMask:
|
||||
@@ -1000,7 +1000,7 @@ static uint32_t get_int (setting_id_t id)
|
||||
break;
|
||||
|
||||
case Setting_ControlPullUpDisableMask:
|
||||
value = settings.control_disable_pullup.mask;
|
||||
value = settings.control_disable_pullup.mask & hal.signals_cap.mask;
|
||||
break;
|
||||
|
||||
case Setting_ProbePullUpDisable:
|
||||
@@ -1630,20 +1630,18 @@ bool setting_is_list (const setting_detail_t *setting)
|
||||
|
||||
static char *remove_element (char *s, uint_fast8_t entry)
|
||||
{
|
||||
if(entry) {
|
||||
while(*s && entry) {
|
||||
if(*s == ',' && --entry == 0)
|
||||
*s = '\0';
|
||||
else
|
||||
s++;
|
||||
}
|
||||
while(entry && *s) {
|
||||
if(*s == ',')
|
||||
entry--;
|
||||
s++;
|
||||
}
|
||||
|
||||
if(entry == 0) {
|
||||
char *s2 = s + 1;
|
||||
if(*s2 == ',')
|
||||
s2++;
|
||||
else while(*s2 && *s2 != ',')
|
||||
*s++ = 'N';
|
||||
*s++ = '/';
|
||||
*s++ = 'A';
|
||||
char *s2 = s;
|
||||
while(*s2 && *s2 != ',')
|
||||
s2++;
|
||||
while(*s2)
|
||||
*s++ = *s2++;
|
||||
@@ -1657,10 +1655,28 @@ static void setting_remove_element (setting_id_t id, uint_fast8_t pos)
|
||||
{
|
||||
const setting_detail_t *setting = setting_get_details(id, NULL);
|
||||
|
||||
if(setting && setting_is_list(setting)) {
|
||||
if(setting && setting_is_list(setting))
|
||||
remove_element((char *)setting->format, pos);
|
||||
if(setting->min_value)
|
||||
remove_element((char *)setting->min_value, pos);
|
||||
}
|
||||
|
||||
// Flag setting elements for bitfields as N/A according to a mask
|
||||
// Note: setting format string has to reside in RAM.
|
||||
void setting_remove_elements (setting_id_t id, uint32_t mask)
|
||||
{
|
||||
char *format = (char *)setting_get_details(id, NULL)->format, *s;
|
||||
uint_fast8_t idx, entries = strnumentries(format, ',');
|
||||
|
||||
for(idx = 0; idx < entries; idx++ ) {
|
||||
if(!(mask & 0x1))
|
||||
setting_remove_element(id, idx);
|
||||
mask >>= 1;
|
||||
}
|
||||
|
||||
// Strip trailing N/A's
|
||||
while((s = strrchr(format, ','))) {
|
||||
if(strncmp(s, ",N/A", 4))
|
||||
break;
|
||||
*s = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1673,22 +1689,7 @@ inline static bool setting_is_core (setting_type_t type)
|
||||
{
|
||||
return !(type == Setting_NonCore || type == Setting_NonCoreFn);
|
||||
}
|
||||
/*
|
||||
static uint32_t get_mask (const char *bits)
|
||||
{
|
||||
uint32_t mask = 0;
|
||||
uint_fast8_t set_idx = 0;
|
||||
float value;
|
||||
|
||||
while(read_float((char *)bits, &set_idx, &value)) {
|
||||
mask |= (1 << (uint8_t)value);
|
||||
if(bits[set_idx] == ',')
|
||||
set_idx++;
|
||||
}
|
||||
|
||||
return mask;
|
||||
}
|
||||
*/
|
||||
status_code_t setting_validate_me (const setting_detail_t *setting, float value, char *svalue)
|
||||
{
|
||||
status_code_t status = Status_OK;
|
||||
@@ -1702,9 +1703,7 @@ status_code_t setting_validate_me (const setting_detail_t *setting, float value,
|
||||
|
||||
case Format_Bitfield:
|
||||
case Format_XBitfield:;
|
||||
if(!(isintf(value) && /* (setting->min_value
|
||||
? (((uint32_t)value & ~get_mask(setting->min_value)) == 0)
|
||||
: */ ((uint32_t)value < (1UL << strnumentries(setting->format, ','))))) //)
|
||||
if(!(isintf(value) && ((uint32_t)value < (1UL << strnumentries(setting->format, ','))))) //)
|
||||
status = Status_SettingValueOutOfRange;
|
||||
break;
|
||||
|
||||
@@ -1887,27 +1886,17 @@ void settings_init (void)
|
||||
hal.probe.configure(false, false);
|
||||
}
|
||||
|
||||
if(!hal.driver_cap.spindle_pwm_invert)
|
||||
setting_remove_element(Setting_SpindleInvertMask, 2);
|
||||
spindle_state_t spindle_cap = {
|
||||
.on = On,
|
||||
.ccw = hal.driver_cap.spindle_dir,
|
||||
.pwm = hal.driver_cap.spindle_pwm_invert
|
||||
};
|
||||
|
||||
if(!hal.signals_cap.motor_fault)
|
||||
setting_remove_element(Setting_ControlInvertMask, 8);
|
||||
/* TODO
|
||||
if(!hal.signals_cap.probe_disconnected)
|
||||
setting_remove_element(Setting_ControlInvertMask, 7);
|
||||
setting_remove_elements(Setting_SpindleInvertMask, spindle_cap.mask);
|
||||
setting_remove_elements(Setting_ControlInvertMask, hal.signals_cap.mask);
|
||||
|
||||
if(!hal.signals_cap.e_stop)
|
||||
setting_remove_element(Setting_ControlInvertMask, 6);
|
||||
|
||||
if(!hal.signals_cap.stop_disable)
|
||||
setting_remove_element(Setting_ControlInvertMask, 5);
|
||||
|
||||
if(!hal.signals_cap.block_delete)
|
||||
setting_remove_element(Setting_ControlInvertMask, 4);
|
||||
|
||||
if(!hal.signals_cap.safety_door_ajar)
|
||||
setting_remove_element(Setting_ControlInvertMask, 3);
|
||||
*/
|
||||
if(!hal.driver_cap.mist_control)
|
||||
setting_remove_element(Setting_CoolantInvertMask, 1);
|
||||
|
||||
setting_details_t *details = settings_get_details();
|
||||
|
||||
|
||||
@@ -227,6 +227,7 @@ typedef enum {
|
||||
Settings_ModBus_BaudRate = 374,
|
||||
Settings_ModBus_RXTimeout = 375,
|
||||
Settings_Axis_Rotational = 376,
|
||||
Setting_BlueToothInitOK = 377,
|
||||
|
||||
Setting_EncoderSettingsBase = 400, // NOTE: Reserving settings values >= 400 for encoder settings. Up to 449.
|
||||
Setting_EncoderSettingsMax = 449,
|
||||
@@ -661,7 +662,11 @@ typedef float (*setting_get_float_ptr)(setting_id_t id);
|
||||
typedef char *(*setting_get_string_ptr)(setting_id_t id);
|
||||
typedef bool (*setting_output_ptr)(const setting_detail_t *setting, uint_fast16_t offset, void *data);
|
||||
|
||||
/*! \brief Pointer to callback function to be called when settings are loaded or changed.
|
||||
\param pointer to \a settings_t struct containing the settings.
|
||||
*/
|
||||
typedef void (*settings_changed_ptr)(settings_t *settings);
|
||||
|
||||
typedef void (*driver_settings_load_ptr)(void);
|
||||
typedef void (*driver_settings_save_ptr)(void);
|
||||
typedef void (*driver_settings_restore_ptr)(void);
|
||||
@@ -728,5 +733,6 @@ setting_group_t settings_normalize_group (setting_group_t group);
|
||||
char *setting_get_value (const setting_detail_t *setting, uint_fast16_t offset);
|
||||
setting_id_t settings_get_axis_base (setting_id_t id, uint_fast8_t *idx);
|
||||
bool setting_is_list (const setting_detail_t *setting);
|
||||
void setting_remove_elements (setting_id_t id, uint32_t mask);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -38,11 +38,11 @@ static void sleep_execute()
|
||||
hal.delay_ms((uint32_t)(SLEEP_DURATION * 1000.0f * 60.0f), fall_asleep);
|
||||
|
||||
// Fetch current number of buffered characters in input stream buffer.
|
||||
uint16_t rx_initial = hal.stream.get_rx_buffer_available();
|
||||
uint16_t rx_initial = hal.stream.get_rx_buffer_free();
|
||||
|
||||
do {
|
||||
// Monitor for any new input stream data or external events (queries, buttons, alarms) to exit.
|
||||
if ((hal.stream.get_rx_buffer_available() != rx_initial) || sys.rt_exec_state || sys.rt_exec_alarm ) {
|
||||
if ((hal.stream.get_rx_buffer_free() != rx_initial) || sys.rt_exec_state || sys.rt_exec_alarm ) {
|
||||
// Disable sleep timeout and return to normal operation.
|
||||
hal.delay_ms(0, NULL);
|
||||
return;
|
||||
|
||||
+16
-5
@@ -73,9 +73,9 @@ typedef struct {
|
||||
} spindle_data_t;
|
||||
|
||||
typedef enum {
|
||||
SpindleData_Counters,
|
||||
SpindleData_RPM,
|
||||
SpindleData_AngularPosition
|
||||
SpindleData_Counters, //!< 0
|
||||
SpindleData_RPM, //!< 1
|
||||
SpindleData_AngularPosition //!< 2
|
||||
} spindle_data_request_t;
|
||||
|
||||
void spindle_set_override (uint_fast8_t speed_override);
|
||||
@@ -100,10 +100,21 @@ bool spindle_restore (spindle_state_t state, float rpm);
|
||||
// The following functions are not called by the core, may be called by driver code.
|
||||
//
|
||||
|
||||
// Precompute PWM values for faster conversion.
|
||||
/*! \brief Precompute PWM values for faster conversion.
|
||||
\param pwm_data pointer t a \a spindle_pwm_t structure.
|
||||
\param clock_hz timer clock frequency used for PWM generation.
|
||||
\returns true if successful, false if no PWM range possible - driver should revert to simple on/off spindle control if so.
|
||||
*/
|
||||
bool spindle_precompute_pwm_values (spindle_pwm_t *pwm_data, uint32_t clock_hz);
|
||||
|
||||
// Spindle speed to PWM conversion.
|
||||
/*! \brief Spindle RPM to PWM conversion.
|
||||
\param pwm_data pointer t a \a spindle_pwm_t structure.
|
||||
\param rpm spindle RPM.
|
||||
\param pid_limit boolean, true if PID based spindle sync is used, false otherwise.
|
||||
|
||||
__NOTE:__ \a spindle_precompute_pwm_values() must be called to precompute values before this function is called.
|
||||
Typically this is done in the \a hal.driver_setup handler.
|
||||
*/
|
||||
uint_fast16_t spindle_compute_pwm_value (spindle_pwm_t *pwm_data, float rpm, bool pid_limit);
|
||||
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -126,7 +126,7 @@ bool state_door_reopened (void)
|
||||
return settings.parking.flags.enabled && park.restart_retract;
|
||||
}
|
||||
|
||||
void state_update (uint_fast16_t rt_exec)
|
||||
void state_update (rt_exec_t rt_exec)
|
||||
{
|
||||
if((rt_exec & EXEC_SAFETY_DOOR) && sys_state != STATE_SAFETY_DOOR)
|
||||
state_set(STATE_SAFETY_DOOR);
|
||||
@@ -139,7 +139,7 @@ sys_state_t state_get (void)
|
||||
return sys_state;
|
||||
}
|
||||
|
||||
void state_set (uint_fast16_t new_state)
|
||||
void state_set (sys_state_t new_state)
|
||||
{
|
||||
if(new_state != sys_state) {
|
||||
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@
|
||||
#define _STATE_MACHINE_H_
|
||||
|
||||
sys_state_t state_get (void);
|
||||
void state_set (uint_fast16_t state);
|
||||
void state_update (uint_fast16_t rt_exec);
|
||||
void state_set (sys_state_t state);
|
||||
void state_update (rt_exec_t rt_exec);
|
||||
bool state_door_reopened (void);
|
||||
void state_suspend_manager (void);
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
|
||||
//#include "debug.h"
|
||||
|
||||
//! \cond
|
||||
|
||||
#ifndef ACCELERATION_TICKS_PER_SECOND
|
||||
#define ACCELERATION_TICKS_PER_SECOND 100
|
||||
#endif
|
||||
@@ -39,6 +41,7 @@
|
||||
#define DT_SEGMENT (1.0f/(ACCELERATION_TICKS_PER_SECOND*60.0f)) // min/segment
|
||||
#define REQ_MM_INCREMENT_SCALAR 1.25f
|
||||
|
||||
|
||||
typedef enum {
|
||||
Ramp_Accel,
|
||||
Ramp_Cruise,
|
||||
@@ -129,6 +132,8 @@ typedef struct {
|
||||
float current_spindle_rpm;
|
||||
} st_prep_t;
|
||||
|
||||
//! \endcond
|
||||
|
||||
static st_prep_t prep;
|
||||
|
||||
|
||||
@@ -274,6 +279,9 @@ ISR_CODE void st_go_idle ()
|
||||
ISR is 5usec typical and 25usec maximum, well below requirement.
|
||||
NOTE: This ISR expects at least one step to be executed per segment.
|
||||
*/
|
||||
|
||||
//! \cond
|
||||
|
||||
ISR_CODE void stepper_driver_interrupt_handler (void)
|
||||
{
|
||||
#ifdef ENABLE_BACKLASH_COMPENSATION
|
||||
@@ -522,6 +530,8 @@ ISR_CODE void stepper_driver_interrupt_handler (void)
|
||||
}
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
// Reset and clear stepper subsystem variables
|
||||
void st_reset ()
|
||||
{
|
||||
|
||||
@@ -31,83 +31,83 @@
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
SquaringMode_Both = 0,
|
||||
SquaringMode_A,
|
||||
SquaringMode_B,
|
||||
SquaringMode_Both = 0, //!< 0
|
||||
SquaringMode_A, //!< 1
|
||||
SquaringMode_B, //!< 2
|
||||
} squaring_mode_t;
|
||||
|
||||
// Holds the planner block Bresenham algorithm execution data for the segments in the segment buffer.
|
||||
// NOTE: This data is copied from the prepped planner blocks so that the planner blocks may be
|
||||
// discarded when entirely consumed and completed by the segment buffer. Also, AMASS alters this
|
||||
// data for its own use.
|
||||
/*! \brief Holds the planner block Bresenham algorithm execution data for the segments in the segment buffer.
|
||||
|
||||
__NOTE:__ This data is copied from the prepped planner blocks so that the planner blocks may be
|
||||
discarded when entirely consumed and completed by the segment buffer. Also, AMASS alters this
|
||||
data for its own use. */
|
||||
typedef struct st_block {
|
||||
uint_fast8_t id; // Id may be used by driver to track changes
|
||||
struct st_block *next; // Pointer to next element in cirular list of blocks
|
||||
uint_fast8_t id; //!< Id may be used by driver to track changes
|
||||
struct st_block *next; //!< Pointer to next element in cirular list of blocks
|
||||
uint32_t steps[N_AXIS];
|
||||
uint32_t step_event_count;
|
||||
axes_signals_t direction_bits;
|
||||
gc_override_flags_t overrides; // Block bitfield variable for overrides
|
||||
gc_override_flags_t overrides; //!< Block bitfield variable for overrides
|
||||
float steps_per_mm;
|
||||
float millimeters;
|
||||
float programmed_rate;
|
||||
char *message; // Message to be displayed when block is executed
|
||||
output_command_t *output_commands; // Output commands (linked list) to be performed when block is executed
|
||||
bool dynamic_rpm; // Tracks motions that require dynamic RPM adjustment
|
||||
char *message; //!< Message to be displayed when block is executed
|
||||
output_command_t *output_commands; //!< Output commands (linked list) to be performed when block is executed
|
||||
bool dynamic_rpm; //!< Tracks motions that require dynamic RPM adjustment
|
||||
bool backlash_motion;
|
||||
} st_block_t;
|
||||
|
||||
typedef struct st_segment {
|
||||
uint_fast8_t id; // Id may be used by driver to track changes
|
||||
struct st_segment *next; // Pointer to next element in cirular list of segments
|
||||
st_block_t *exec_block; // Pointer to the block data for the segment
|
||||
uint32_t cycles_per_tick; // Step distance traveled per ISR tick, aka step rate.
|
||||
uint_fast8_t id; //!< Id may be used by driver to track changes
|
||||
struct st_segment *next; //!< Pointer to next element in cirular list of segments
|
||||
st_block_t *exec_block; //!< Pointer to the block data for the segment
|
||||
uint32_t cycles_per_tick; //!< Step distance traveled per ISR tick, aka step rate.
|
||||
float current_rate;
|
||||
float target_position; // Target position of segment relative to block start, used by spindle sync code
|
||||
uint_fast16_t n_step; // Number of step events to be executed for this segment
|
||||
float target_position; //!< Target position of segment relative to block start, used by spindle sync code
|
||||
uint_fast16_t n_step; //!< Number of step events to be executed for this segment
|
||||
#ifdef SPINDLE_PWM_DIRECT
|
||||
uint_fast16_t spindle_pwm; // Spindle PWM to be set at the start of segment execution
|
||||
uint_fast16_t spindle_pwm; //!< Spindle PWM to be set at the start of segment execution
|
||||
#else
|
||||
float spindle_rpm; // Spindle RPM to be set at the start of the segment execution
|
||||
float spindle_rpm; //!< Spindle RPM to be set at the start of the segment execution
|
||||
#endif
|
||||
bool update_rpm; // True if set spindle speed at the start of the segment execution
|
||||
bool spindle_sync; // True if block is spindle synchronized
|
||||
bool cruising; // True when in cruising part of profile, only set for spindle synced moves
|
||||
uint_fast8_t amass_level; // Indicates AMASS level for the ISR to execute this segment
|
||||
bool update_rpm; //!< True if set spindle speed at the start of the segment execution
|
||||
bool spindle_sync; //!< True if block is spindle synchronized
|
||||
bool cruising; //!< True when in cruising part of profile, only set for spindle synced moves
|
||||
uint_fast8_t amass_level; //!< Indicates AMASS level for the ISR to execute this segment
|
||||
} segment_t;
|
||||
|
||||
// Stepper ISR data struct. Contains the running data for the main stepper ISR.
|
||||
typedef struct {
|
||||
// Used by the bresenham line algorithm
|
||||
uint32_t counter_x, // Counter variables for the bresenham line tracer
|
||||
counter_y,
|
||||
counter_z
|
||||
//! Stepper ISR data struct. Contains the running data for the main stepper ISR.
|
||||
typedef struct stepper {
|
||||
uint32_t counter_x, //!< Counter variable for the Bresenham line tracer, X-axis
|
||||
counter_y, //!< Counter variable for the Bresenham line tracer, Y-axis
|
||||
counter_z //!< Counter variable for the Bresenham line tracer, Z-axis
|
||||
#ifdef A_AXIS
|
||||
, counter_a
|
||||
, counter_a //!< Counter variable for the Bresenham line tracer, A-axis
|
||||
#endif
|
||||
#ifdef B_AXIS
|
||||
, counter_b
|
||||
, counter_b //!< Counter variable for the Bresenham line tracer, B-axis
|
||||
#endif
|
||||
#ifdef C_AXIS
|
||||
, counter_c
|
||||
, counter_c //!< Counter variable for the Bresenham line tracer, C-axis
|
||||
#endif
|
||||
#ifdef C_AXIS
|
||||
, counter_u
|
||||
#ifdef U_AXIS
|
||||
, counter_u //!< Counter variable for the Bresenham line tracer, U-axis
|
||||
#endif
|
||||
#ifdef C_AXIS
|
||||
, counter_v
|
||||
#ifdef V_AXIS
|
||||
, counter_v //!< Counter variable for the Bresenham line tracer, V-axis
|
||||
#endif
|
||||
;
|
||||
bool new_block; // Set to true when a new block is started, might be used by driver for advanced functionality
|
||||
bool dir_change; // Set to true on direction changes, might be used by driver for advanced functionality
|
||||
axes_signals_t step_outbits; // The next stepping-bits to be output
|
||||
axes_signals_t dir_outbits; // The next direction-bits to be output
|
||||
uint32_t steps[N_AXIS];
|
||||
uint_fast8_t amass_level; // AMASS level for this segment
|
||||
bool new_block; //!< Set to true when a new block is started, might be referenced by driver code for advanced functionality.
|
||||
bool dir_change; //!< Set to true on direction changes, might be referenced by driver for advanced functionality.
|
||||
axes_signals_t step_outbits; //!< The stepping signals to be output.
|
||||
axes_signals_t dir_outbits; //!< The direction signals to be output. The direction signals may be output only when \ref stepper.dir_change is true to reduce overhead.
|
||||
uint32_t steps[N_AXIS]; //!< Number of step pulse event events per axis step pulse generated.
|
||||
uint_fast8_t amass_level; //!< AMASS level for this segment.
|
||||
// uint_fast16_t spindle_pwm;
|
||||
uint_fast16_t step_count; // Steps remaining in line segment motion
|
||||
uint32_t step_event_count;
|
||||
st_block_t *exec_block; // Pointer to the block data for the segment being executed
|
||||
segment_t *exec_segment; // Pointer to the segment being executed
|
||||
uint_fast16_t step_count; //!< Steps remaining in line segment motion.
|
||||
uint32_t step_event_count; //!< Number of step pulse events to be output by this segment.
|
||||
st_block_t *exec_block; //!< Pointer to the block data for the segment being executed.
|
||||
segment_t *exec_segment; //!< Pointer to the segment beeing executed.
|
||||
} stepper_t;
|
||||
|
||||
// Initialize and setup the stepper motor subsystem
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*! \file
|
||||
Helper functions for saving away and restoring a stream input buffer. _Not referenced by the core._
|
||||
*/
|
||||
|
||||
#ifndef _STREAM_H_
|
||||
#define _STREAM_H_
|
||||
|
||||
@@ -111,8 +115,21 @@ typedef struct {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*! \brief Dummy function for reading data from a virtual empty input buffer.
|
||||
\returns always -1 as there is no data available.
|
||||
*/
|
||||
int16_t stream_get_null (void);
|
||||
|
||||
/*! \brief Function for blocking reads from or restoring an input buffer.
|
||||
\param rxbuffer pointer to a stream_rx_buffer_t.
|
||||
\param suspend when true _hal.stream.read_ is changed to stream_get_null(), if false it is restored if already saved.
|
||||
\returns true if there is data in the buffer, false otherwise.
|
||||
*/
|
||||
bool stream_rx_suspend (stream_rx_buffer_t *rxbuffer, bool suspend);
|
||||
|
||||
/*! \brief Function for saving away an input buffer.
|
||||
\param rxbuffer pointer to a stream_rx_buffer_t.
|
||||
*/
|
||||
void stream_rx_backup (stream_rx_buffer_t *rxbuffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -847,8 +847,10 @@ void system_apply_jog_limits (float *target)
|
||||
|
||||
void system_raise_alarm (alarm_code_t alarm)
|
||||
{
|
||||
sys.alarm = alarm;
|
||||
state_set(alarm == Alarm_EStop ? STATE_ESTOP : STATE_ALARM);
|
||||
if(sys.driver_started)
|
||||
report_alarm_message(alarm);
|
||||
if(sys.alarm != alarm) {
|
||||
sys.alarm = alarm;
|
||||
state_set(alarm == Alarm_EStop ? STATE_ESTOP : STATE_ALARM);
|
||||
if(sys.driver_started)
|
||||
report_alarm_message(alarm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,17 @@
|
||||
#include "probe.h"
|
||||
#include "alarms.h"
|
||||
|
||||
// Define system executor bit map. Used internally by realtime protocol as realtime command flags,
|
||||
// which notifies the main program to execute the specified realtime command asynchronously.
|
||||
// NOTE: The system executor uses an unsigned 16-bit volatile variable (16 flag limit.) The default
|
||||
// flags are always false, so the realtime protocol only needs to check for a non-zero value to
|
||||
// know when there is a realtime command to execute.
|
||||
/*! @name System executor bit map.
|
||||
\anchor rt_exec
|
||||
|
||||
Used internally by realtime protocol as realtime command flags,
|
||||
which notifies the main program to execute the specified realtime command asynchronously.
|
||||
|
||||
__NOTE__: The system executor uses an unsigned 16-bit volatile variable (16 flag limit.) The default
|
||||
flags are always false, so the realtime protocol only needs to check for a non-zero value to
|
||||
know when there is a realtime command to execute.
|
||||
*/
|
||||
///@{
|
||||
#define EXEC_STATUS_REPORT bit(0)
|
||||
#define EXEC_CYCLE_START bit(1)
|
||||
#define EXEC_CYCLE_COMPLETE bit(2)
|
||||
@@ -46,60 +52,71 @@
|
||||
#define EXEC_GCODE_REPORT bit(11)
|
||||
#define EXEC_TLO_REPORT bit(12)
|
||||
#define EXEC_RT_COMMAND bit(13)
|
||||
///@}
|
||||
|
||||
// Define system state bit map. The state variable primarily tracks the individual functions
|
||||
// of Grbl to manage each without overlapping. It is also used as a messaging flag for
|
||||
// critical events.
|
||||
// NOTE: flags are mutually exclusive, bit map allows testing for multiple states (except STATE_IDLE) in a single statement
|
||||
#define STATE_IDLE 0 // Must be zero. No flags.
|
||||
#define STATE_ALARM bit(0) // In alarm state. Locks out all g-code processes. Allows settings access.
|
||||
#define STATE_CHECK_MODE bit(1) // G-code check mode. Locks out planner and motion only.
|
||||
#define STATE_HOMING bit(2) // Performing homing cycle
|
||||
#define STATE_CYCLE bit(3) // Cycle is running or motions are being executed.
|
||||
#define STATE_HOLD bit(4) // Active feed hold
|
||||
#define STATE_JOG bit(5) // Jogging mode.
|
||||
#define STATE_SAFETY_DOOR bit(6) // Safety door is ajar. Feed holds and de-energizes system.
|
||||
#define STATE_SLEEP bit(7) // Sleep state.
|
||||
#define STATE_ESTOP bit(8) // EStop mode, reports and is mainly handled similar to alarm state
|
||||
#define STATE_TOOL_CHANGE bit(9) // Manual tool change, similar to STATE_HOLD - but stops spindle and allows jogging.
|
||||
//! \def sys_state
|
||||
/*! @name System state bit map.
|
||||
\anchor sys_state
|
||||
|
||||
// Define Grbl feedback message codes. Valid values (0-255).
|
||||
The state variable (type \ref sys_state_t) primarily tracks the individual states of grblHAL to manage each without overlapping.
|
||||
It is also used as a messaging flag for critical events.
|
||||
|
||||
It is encapsulated by the main state machine in state_machine.c and can only be set via the state_set() or state_update() functions and read via the state_get() function.
|
||||
|
||||
__NOTE:__ flags are mutually exclusive, bit map allows testing for multiple states (except #STATE_IDLE) in a single statement
|
||||
*/
|
||||
///@{
|
||||
#define STATE_IDLE 0 //!< Must be zero. No flags.
|
||||
#define STATE_ALARM bit(0) //!< In alarm state. Locks out all g-code processes. Allows settings access.
|
||||
#define STATE_CHECK_MODE bit(1) //!< G-code check mode. Locks out planner and motion only.
|
||||
#define STATE_HOMING bit(2) //!< Performing homing cycle
|
||||
#define STATE_CYCLE bit(3) //!< Cycle is running or motions are being executed.
|
||||
#define STATE_HOLD bit(4) //!< Active feed hold
|
||||
#define STATE_JOG bit(5) //!< Jogging mode.
|
||||
#define STATE_SAFETY_DOOR bit(6) //!< Safety door is ajar. Feed holds and de-energizes system.
|
||||
#define STATE_SLEEP bit(7) //!< Sleep state.
|
||||
#define STATE_ESTOP bit(8) //!< EStop mode, reports and is mainly handled similar to alarm state
|
||||
#define STATE_TOOL_CHANGE bit(9) //!< Manual tool change, similar to #STATE_HOLD - but stops spindle and allows jogging.
|
||||
///@}
|
||||
|
||||
// Define feedback message codes. Valid values (0-255).
|
||||
typedef enum {
|
||||
Message_None = 0, // Reserved, do not change value
|
||||
Message_CriticalEvent = 1,
|
||||
Message_AlarmLock = 2,
|
||||
Message_AlarmUnlock = 3,
|
||||
Message_Enabled = 4,
|
||||
Message_Disabled = 5,
|
||||
Message_SafetyDoorAjar = 6,
|
||||
Message_CheckLimits = 7,
|
||||
Message_ProgramEnd = 8,
|
||||
Message_RestoreDefaults = 9,
|
||||
Message_SpindleRestore = 10,
|
||||
Message_SleepMode = 11,
|
||||
Message_EStop = 12,
|
||||
Message_HomingCycleRequired = 13,
|
||||
Message_CycleStartToRerun = 14,
|
||||
Message_ReferenceTLOEstablished = 15,
|
||||
Message_MotorFault = 16,
|
||||
Message_NextMessage // Next unassigned message number
|
||||
Message_None = 0, //!< 0 - reserved, do not change value.
|
||||
Message_CriticalEvent = 1, //!< 1
|
||||
Message_AlarmLock = 2, //!< 2
|
||||
Message_AlarmUnlock = 3, //!< 3
|
||||
Message_Enabled = 4, //!< 4
|
||||
Message_Disabled = 5, //!< 5
|
||||
Message_SafetyDoorAjar = 6, //!< 6
|
||||
Message_CheckLimits = 7, //!< 7
|
||||
Message_ProgramEnd = 8, //!< 8
|
||||
Message_RestoreDefaults = 9, //!< 9
|
||||
Message_SpindleRestore = 10, //!< 10
|
||||
Message_SleepMode = 11, //!< 11
|
||||
Message_EStop = 12, //!< 12
|
||||
Message_HomingCycleRequired = 13, //!< 13
|
||||
Message_CycleStartToRerun = 14, //!< 14
|
||||
Message_ReferenceTLOEstablished = 15, //!< 15
|
||||
Message_MotorFault = 16, //!< 16
|
||||
Message_NextMessage //!< 17 - next unassigned message number.
|
||||
} message_code_t;
|
||||
|
||||
typedef enum {
|
||||
Parking_DoorClosed = 0,
|
||||
Parking_DoorAjar,
|
||||
Parking_Retracting,
|
||||
Parking_Cancel,
|
||||
Parking_Resuming
|
||||
Parking_DoorClosed = 0, //!< 0
|
||||
Parking_DoorAjar, //!< 1
|
||||
Parking_Retracting, //!< 2
|
||||
Parking_Cancel, //!< 3
|
||||
Parking_Resuming //!< 4
|
||||
} parking_state_t;
|
||||
|
||||
typedef enum {
|
||||
Hold_NotHolding = 0,
|
||||
Hold_Complete = 1,
|
||||
Hold_Pending = 2
|
||||
Hold_NotHolding = 0, //!< 0
|
||||
Hold_Complete = 1, //!< 1
|
||||
Hold_Pending = 2 //!< 2
|
||||
} hold_state_t;
|
||||
|
||||
typedef uint_fast16_t sys_state_t;
|
||||
typedef uint_fast16_t rt_exec_t; //!< See \ref rt_exec
|
||||
typedef uint_fast16_t sys_state_t; //!< See \ref sys_state
|
||||
|
||||
// Define step segment generator state flags.
|
||||
typedef union {
|
||||
@@ -123,7 +140,7 @@ typedef union {
|
||||
cycle_start :1,
|
||||
safety_door_ajar :1,
|
||||
block_delete :1,
|
||||
stop_disable :1, // M1
|
||||
stop_disable :1, //! M1
|
||||
e_stop :1,
|
||||
probe_disconnected :1,
|
||||
motor_fault :1,
|
||||
@@ -131,8 +148,8 @@ typedef union {
|
||||
limits_override :1,
|
||||
single_block :1,
|
||||
unassigned :2,
|
||||
probe_triggered :1, // used for probe protection
|
||||
deasserted :1; // this flag is set if signals are deasserted. Note: do NOT pass on to Grbl control_interrupt_handler if set.
|
||||
probe_triggered :1, //! used for probe protection
|
||||
deasserted :1; //! this flag is set if signals are deasserted. Note: do NOT pass on to the control_interrupt_handler if set.
|
||||
};
|
||||
} control_signals_t;
|
||||
|
||||
@@ -162,47 +179,49 @@ typedef struct {
|
||||
#endif
|
||||
|
||||
typedef union {
|
||||
uint16_t value;
|
||||
uint32_t value;
|
||||
struct {
|
||||
uint16_t mpg_mode :1, // MPG mode changed.
|
||||
scaling :1, // Scaling (G50/G51) changed.
|
||||
homed :1, // Homed state changed.
|
||||
xmode :1, // Lathe radius/diameter mode changed.
|
||||
spindle :1, // Spindle state changed.
|
||||
coolant :1, // Coolant state changed.
|
||||
overrides :1, // Overrides changed.
|
||||
tool :1, // Tool changed.
|
||||
wco :1, // Add work coordinates.
|
||||
gwco :1, // Add work coordinate.
|
||||
tool_offset :1, // Tool offsets changed.
|
||||
pwm :1, // Add PWM information (optional: to be added by driver).
|
||||
motor :1, // Add motor information (optional: to be added by driver).
|
||||
encoder :1, // Add encoder information (optional: to be added by driver).
|
||||
tlo_reference :1, // Tool length offset reference changed
|
||||
all :1; // Set when CMD_STATUS_REPORT_ALL is requested, may be used by user code
|
||||
uint32_t mpg_mode :1, //!< MPG mode changed.
|
||||
scaling :1, //!< Scaling (G50/G51) changed.
|
||||
homed :1, //!< Homed state changed.
|
||||
xmode :1, //!< Lathe radius/diameter mode changed.
|
||||
spindle :1, //!< Spindle state changed.
|
||||
coolant :1, //!< Coolant state changed.
|
||||
overrides :1, //!< Overrides changed.
|
||||
tool :1, //!< Tool changed.
|
||||
wco :1, //!< Add work coordinates.
|
||||
gwco :1, //!< Add work coordinate.
|
||||
tool_offset :1, //!< Tool offsets changed.
|
||||
m66result :1, //!< M66 result updated
|
||||
pwm :1, //!< Add PWM information (optional: to be added by driver).
|
||||
motor :1, //!< Add motor information (optional: to be added by driver).
|
||||
encoder :1, //!< Add encoder information (optional: to be added by driver).
|
||||
tlo_reference :1, //!< Tool length offset reference changed
|
||||
unassigned :15, //
|
||||
all :1; //!< Set when CMD_STATUS_REPORT_ALL is requested, may be used by user code
|
||||
};
|
||||
} report_tracking_flags_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t feed_rate; // Feed rate override value in percent
|
||||
uint8_t rapid_rate; // Rapids override value in percent
|
||||
uint8_t spindle_rpm; // Spindle speed override value in percent
|
||||
spindle_stop_t spindle_stop; // Tracks spindle stop override states
|
||||
gc_override_flags_t control; // Tracks override control states.
|
||||
uint8_t feed_rate; //!< Feed rate override value in percent
|
||||
uint8_t rapid_rate; //!< Rapids override value in percent
|
||||
uint8_t spindle_rpm; //!< Spindle speed override value in percent
|
||||
spindle_stop_t spindle_stop; //!< Tracks spindle stop override states
|
||||
gc_override_flags_t control; //!< Tracks override control states.
|
||||
} overrides_t;
|
||||
|
||||
typedef union {
|
||||
uint16_t value;
|
||||
struct {
|
||||
uint16_t mpg_mode :1, // MPG mode flag. Set when switched to secondary input stream. (unused for now)
|
||||
probe_succeeded :1, // Tracks if last probing cycle was successful.
|
||||
soft_limit :1, // Tracks soft limit errors for the state machine.
|
||||
exit :1, // System exit flag. Used in combination with abort to terminate main loop.
|
||||
block_delete_enabled :1, // Set to true to enable block delete
|
||||
uint16_t mpg_mode :1, //!< MPG mode flag. Set when switched to secondary input stream. (unused for now)
|
||||
probe_succeeded :1, //!< Tracks if last probing cycle was successful.
|
||||
soft_limit :1, //!< Tracks soft limit errors for the state machine.
|
||||
exit :1, //!< System exit flag. Used in combination with abort to terminate main loop.
|
||||
block_delete_enabled :1, //!< Set to true to enable block delete
|
||||
feed_hold_pending :1,
|
||||
delay_overrides :1,
|
||||
optional_stop_disable :1,
|
||||
single_block :1; // Set to true to disable M1 (optional stop), via realtime command
|
||||
single_block :1; //!< Set to true to disable M1 (optional stop), via realtime command
|
||||
};
|
||||
} system_flags_t;
|
||||
|
||||
@@ -212,43 +231,48 @@ typedef struct
|
||||
limit_signals_t limits;
|
||||
} signal_event_t;
|
||||
|
||||
// Define global system variables
|
||||
//! Global system variables struct.
|
||||
// NOTE: probe_position and position variables may need to be declared as volatiles, if problems arise.
|
||||
typedef struct {
|
||||
bool abort; // System abort flag. Forces exit back to main loop for reset.
|
||||
bool cancel; // System cancel flag.
|
||||
bool suspend; // System suspend state flag.
|
||||
bool position_lost; // Set when mc_reset is called when machine is moving.
|
||||
volatile bool steppers_deenergize; // Set to true to deenergize stepperes
|
||||
axes_signals_t tlo_reference_set; // Axes with tool length reference offset set
|
||||
int32_t tlo_reference[N_AXIS]; // Tool length reference offset
|
||||
alarm_code_t alarm_pending; // Delayed alarm, currently used for probe protection
|
||||
system_flags_t flags; // Assorted state flags
|
||||
step_control_t step_control; // Governs the step segment generator depending on system state.
|
||||
axes_signals_t homing_axis_lock; // Locks axes when limits engage. Used as an axis motion mask in the stepper ISR.
|
||||
axes_signals_t homing; // Axes with homing enabled.
|
||||
overrides_t override; // Override values & states
|
||||
report_tracking_flags_t report; // Tracks when to add data to status reports.
|
||||
parking_state_t parking_state; // Tracks parking state
|
||||
hold_state_t holding_state; // Tracks holding state
|
||||
int32_t probe_position[N_AXIS]; // Last probe position in machine coordinates and steps.
|
||||
volatile probing_state_t probing_state; // Probing state value. Used to coordinate the probing cycle with stepper ISR.
|
||||
volatile uint_fast16_t rt_exec_state; // Realtime executor bitflag variable for state management. See EXEC bitmasks.
|
||||
volatile uint_fast16_t rt_exec_alarm; // Realtime executor bitflag variable for setting various alarms.
|
||||
float spindle_rpm;
|
||||
typedef struct system {
|
||||
bool abort; //!< System abort flag. Forces exit back to main loop for reset.
|
||||
bool cancel; //!< System cancel flag.
|
||||
bool suspend; //!< System suspend state flag.
|
||||
bool position_lost; //!< Set when mc_reset is called when machine is moving.
|
||||
volatile bool steppers_deenergize; //!< Set to true to deenergize stepperes
|
||||
axes_signals_t tlo_reference_set; //!< Axes with tool length reference offset set
|
||||
int32_t tlo_reference[N_AXIS]; //!< Tool length reference offset
|
||||
alarm_code_t alarm_pending; //!< Delayed alarm, currently used for probe protection
|
||||
system_flags_t flags; //!< Assorted state flags
|
||||
step_control_t step_control; //!< Governs the step segment generator depending on system state.
|
||||
axes_signals_t homing_axis_lock; //!< Locks axes when limits engage. Used as an axis motion mask in the stepper ISR.
|
||||
axes_signals_t homing; //!< Axes with homing enabled.
|
||||
overrides_t override; //!< Override values & states
|
||||
report_tracking_flags_t report; //!< Tracks when to add data to status reports.
|
||||
parking_state_t parking_state; //!< Tracks parking state
|
||||
hold_state_t holding_state; //!< Tracks holding state
|
||||
int32_t probe_position[N_AXIS]; //!< Last probe position in machine coordinates and steps.
|
||||
volatile probing_state_t probing_state; //!< Probing state value. Used to coordinate the probing cycle with stepper ISR.
|
||||
volatile rt_exec_t rt_exec_state; //!< Realtime executor bitflag variable for state management. See EXEC bitmasks.
|
||||
volatile uint_fast16_t rt_exec_alarm; //!< Realtime executor bitflag variable for setting various alarms.
|
||||
float spindle_rpm; //!< Current spindle RPM
|
||||
int32_t var5933; //!< Last result from M66 - wait on input
|
||||
#ifdef PID_LOG
|
||||
pid_data_t pid_log;
|
||||
#endif
|
||||
// The following variables are only cleared upon soft reset if position is likely lost, do NOT move. homed must be first!
|
||||
axes_signals_t homed; // Indicates which axes has been homed.
|
||||
float home_position[N_AXIS]; // Home position for homed axes
|
||||
// The following variables are not cleared upon soft reset, do NOT move. alarm must be first!
|
||||
alarm_code_t alarm; // Current alarm, only valid if system state is STATE_ALARM.
|
||||
bool cold_start; // Set to true on boot, is false on subsequent soft resets.
|
||||
bool driver_started; // Set to true when driver initialization is completed.
|
||||
bool mpg_mode; // To be moved to system_flags_t
|
||||
signal_event_t last_event; // Last signal events (control and limits signal).
|
||||
int32_t position[N_AXIS]; // Real-time machine (aka home) position vector in steps.
|
||||
//! @name The following variables are only cleared upon soft reset if position is likely lost, do NOT move. homed must be first!
|
||||
//@{
|
||||
axes_signals_t homed; //!< Indicates which axes has been homed.
|
||||
float home_position[N_AXIS]; //!< Home position for homed axes
|
||||
//@}
|
||||
//! @name The following variables are not cleared upon soft reset, do NOT move. alarm must be first!
|
||||
//@{
|
||||
alarm_code_t alarm; //!< Current alarm, only valid if system state is STATE_ALARM.
|
||||
bool cold_start; //!< Set to true on boot, is false on subsequent soft resets.
|
||||
bool driver_started; //!< Set to true when driver initialization is completed.
|
||||
bool mpg_mode; //!< To be moved to system_flags_t
|
||||
signal_event_t last_event; //!< Last signal events (control and limits signal).
|
||||
int32_t position[N_AXIS]; //!< Real-time machine (aka home) position vector in steps.
|
||||
//@}
|
||||
} system_t;
|
||||
|
||||
typedef status_code_t (*sys_command_ptr)(sys_state_t state, char *args);
|
||||
@@ -268,10 +292,10 @@ typedef struct sys_commands_str {
|
||||
|
||||
extern system_t sys;
|
||||
|
||||
// Executes an internal system command, defined as a string starting with a '$'
|
||||
//! Executes an internal system command, defined as a string starting with a '$'
|
||||
status_code_t system_execute_line (char *line);
|
||||
|
||||
// Execute the startup script lines stored in non-volatile storage upon initialization
|
||||
//! Execute the startup script lines stored in non-volatile storage upon initialization
|
||||
void system_execute_startup (void);
|
||||
|
||||
void system_flag_wco_change (void);
|
||||
@@ -279,16 +303,16 @@ void system_flag_wco_change (void);
|
||||
// Returns machine position of axis 'idx'. Must be sent a 'step' array.
|
||||
//float system_convert_axis_steps_to_mpos(int32_t *steps, uint_fast8_t idx);
|
||||
|
||||
// Updates a machine 'position' array based on the 'step' array sent.
|
||||
//! Updates a machine 'position' array based on the 'step' array sent.
|
||||
void system_convert_array_steps_to_mpos (float *position, int32_t *steps);
|
||||
|
||||
// Checks and reports if target array exceeds machine travel limits.
|
||||
//! Checks and reports if target array exceeds machine travel limits.
|
||||
bool system_check_travel_limits (float *target);
|
||||
|
||||
// Checks and limit jog commands to within machine travel limits.
|
||||
//! Checks and limit jog commands to within machine travel limits.
|
||||
void system_apply_jog_limits (float *target);
|
||||
|
||||
// Raise and report alarm state
|
||||
//! Raise and report alarm state
|
||||
void system_raise_alarm (alarm_code_t alarm);
|
||||
|
||||
// Special handlers for setting and clearing Grbl's real-time execution flags.
|
||||
|
||||
Reference in New Issue
Block a user