Simplified keypad and MPG symbol handling.

This commit is contained in:
Terje Io
2024-08-17 22:04:58 +02:00
parent 7ade244a78
commit 7725fab5b8
5 changed files with 44 additions and 37 deletions

View File

@@ -13,7 +13,7 @@ It has been written to complement grblHAL and has features such as proper keyboa
---
Latest build date is 20240719, see the [changelog](changelog.md) for details.
Latest build date is 20240817, see the [changelog](changelog.md) for details.
__NOTE:__ Build 20240222 has moved the probe input to the ioPorts pool of inputs and will be allocated from it when configured.
The change is major and _potentially dangerous_, it may damage your probe, so please _verify correct operation_ after installing this, or later, builds.

View File

@@ -1,5 +1,23 @@
## grblHAL changelog
<a name="20240817">Build 20240817
Core:
* Simplified keypad and MPG symbol handling.
Drivers:
* Most: updated for simplified keypad and MPG symbol handling.
* LPC176x: added support for keypad and MPG plugin. I2C keypad not fully supported and not tested.
Plugins:
* Keypad: updated for simplified keypad and MPG symbol handling.
---
<a name="20240812">Build 20240812
Core:
@@ -14,7 +32,7 @@ Core:
Drivers:
* imXRT1061, MSP432, STM32F4xx, STM32F7xx: Updated to take advandage of new spindle encoder binding functionality.
* imXRT1061, MSP432, STM32F4xx, STM32F7xx: updated to take advantage of new spindle encoder binding functionality.
Plugins:

View File

@@ -94,26 +94,33 @@
#define SERIAL_STREAM 0
#endif
#ifndef KEYPAD_ENABLE
#define KEYPAD_ENABLE 0
#endif
#ifndef MACROS_ENABLE
#define MACROS_ENABLE 0
#endif
#ifndef MPG_ENABLE
#define MPG_ENABLE 0
#ifndef KEYPAD_ENABLE
#define KEYPAD_ENABLE 0
#endif
#if MPG_ENABLE == 1 && KEYPAD_ENABLE == 2
#define MPG_MODE 2
#elif MPG_ENABLE == 2
#define MPG_MODE 3
#elif MPG_ENABLE
#define MPG_MODE 1
#if KEYPAD_ENABLE == 1
#ifdef I2C_STROBE_ENABLE
#undef I2C_STROBE_ENABLE
#endif
#define I2C_STROBE_ENABLE 1
#elif KEYPAD_ENABLE == 2 && !defined(KEYPAD_STREAM)
#if USB_SERIAL_CDC
#define KEYPAD_STREAM 0
#else
#define MPG_MODE 0
#define KEYPAD_STREAM 1
#endif
#endif
#ifndef I2C_STROBE_ENABLE
#define I2C_STROBE_ENABLE 0
#endif
#ifndef MPG_ENABLE
#define MPG_ENABLE 0
#endif
#if MPG_ENABLE && !defined(MPG_STREAM)
@@ -124,24 +131,6 @@
#endif
#endif
#if KEYPAD_ENABLE == 1
#ifdef I2C_STROBE_ENABLE
#undef I2C_STROBE_ENABLE
#endif
#define I2C_STROBE_ENABLE 1
#elif KEYPAD_ENABLE == 2 && !defined(MPG_STREAM)
#ifndef KEYPAD_STREAM
#if USB_SERIAL_CDC
#define KEYPAD_STREAM 0
#else
#define KEYPAD_STREAM 1
#endif
#endif
#endif
#ifndef I2C_STROBE_ENABLE
#define I2C_STROBE_ENABLE 0
#endif
#if DISPLAY_ENABLE == 2
#ifdef I2C_ENABLE
#undef I2C_ENABLE

2
grbl.h
View File

@@ -42,7 +42,7 @@
#else
#define GRBL_VERSION "1.1f"
#endif
#define GRBL_BUILD 20240812
#define GRBL_BUILD 20240817
#define GRBL_URL "https://github.com/grblHAL"

View File

@@ -43,7 +43,7 @@
#error "I2C keypad/strobe is not supported in this configuration!"
#endif
#if MPG_MODE == 1 && !defined(MPG_MODE_PIN)
#if MPG_ENABLE == 1 && !defined(MPG_MODE_PIN)
#error "MPG mode input is not supported in this configuration!"
#endif
@@ -197,7 +197,7 @@
#if SAFETY_DOOR_ENABLE || MOTOR_FAULT_ENABLE || MOTOR_WARNING_ENABLE || PROBE_DISCONNECT_ENABLE || \
STOP_DISABLE_ENABLE || BLOCK_DELETE_ENABLE || SINGLE_BLOCK_ENABLE || LIMITS_OVERRIDE_ENABLE || \
(defined(AUX_DEVICES) && (PROBE_ENABLE || I2C_STROBE_ENABLE || MPG_MODE == 1 || QEI_SELECT_ENABLE)) || defined __DOXYGEN__
(defined(AUX_DEVICES) && (PROBE_ENABLE || I2C_STROBE_ENABLE || MPG_ENABLE == 1 || QEI_SELECT_ENABLE)) || defined __DOXYGEN__
#define AUX_CONTROLS_ENABLED 1
@@ -244,7 +244,7 @@ static aux_ctrl_t aux_ctrl[] = {
{ .function = Input_I2CStrobe, .aux_port = 0xFF, .irq_mode = (pin_irq_mode_t)(IRQ_Mode_Change), .cap = { .value = 0 }, .pin = I2C_STROBE_PIN, .port = NULL },
#endif
#endif
#if MPG_MODE == 1 && defined(MPG_MODE_PIN) && defined(AUX_DEVICES)
#if MPG_ENABLE == 1 && defined(MPG_MODE_PIN) && defined(AUX_DEVICES)
#ifdef MPG_MODE_PORT
{ .function = Input_MPGSelect, .aux_port = 0xFF, .irq_mode = (pin_irq_mode_t)(IRQ_Mode_Change), .cap = { .value = 0 }, .pin = MPG_MODE_PIN, .port = MPG_MODE_PORT },
#else