diff --git a/g2core/board/ArduinoDue.mk b/g2core/board/ArduinoDue.mk index dfd8174e..d0c1fe3d 100755 --- a/g2core/board/ArduinoDue.mk +++ b/g2core/board/ArduinoDue.mk @@ -62,7 +62,7 @@ ifeq ("$(BASE_BOARD)","g2core-due") # Note: we call it "g2core-due" instead of "due" since the Motate built-in provides # a "due" BASE_BOARD. BOARD_PATH = ./board/ArduinoDue - SOURCE_DIRS += ${BOARD_PATH} device/step_dir_driver + SOURCE_DIRS += ${BOARD_PATH} device/step_dir_driver device/esc_spindle PLATFORM_BASE = ${MOTATE_PATH}/platform/atmel_sam diff --git a/g2core/board/ArduinoDue/0_hardware.cpp b/g2core/board/ArduinoDue/0_hardware.cpp index 3263acee..7332830e 100644 --- a/g2core/board/ArduinoDue/0_hardware.cpp +++ b/g2core/board/ArduinoDue/0_hardware.cpp @@ -1,6 +1,6 @@ /* * hardware.cpp - general hardware support functions - * For: /board/g2v9 + * For: /board/ArduinoDue * This file is part of the g2core project * * Copyright (c) 2010 - 2018 Alden S. Hart, Jr. @@ -38,6 +38,42 @@ #include "MotateUniqueID.h" #include "MotatePower.h" +#include "board_gpio.h" + +#ifndef SPINDLE_ENABLE_OUTPUT_NUMBER +#warning SPINDLE_ENABLE_OUTPUT_NUMBER is defaulted to 4! +#warning SPINDLE_ENABLE_OUTPUT_NUMBER should be defined in settings or a board file! +#define SPINDLE_ENABLE_OUTPUT_NUMBER 4 +#endif + +#ifndef SPINDLE_DIRECTION_OUTPUT_NUMBER +#warning SPINDLE_DIRECTION_OUTPUT_NUMBER is defaulted to 5! +#warning SPINDLE_DIRECTION_OUTPUT_NUMBER should be defined in settings or a board file! +#define SPINDLE_DIRECTION_OUTPUT_NUMBER 5 +#endif + +#ifndef SPINDLE_PWM_NUMBER +#warning SPINDLE_PWM_NUMBER is defaulted to 6! +#warning SPINDLE_PWM_NUMBER should be defined in settings or a board file! +#define SPINDLE_PWM_NUMBER 6 +#endif + +#include "safety_manager.h" + +SafetyManager sm{}; +SafetyManager *safety_manager = &sm; + +// Stub in getSysConfig_3 +// constexpr cfgItem_t sys_config_items_3[] = {}; +constexpr cfgSubtableFromStaticArray sys_config_3{}; +const configSubtable * const getSysConfig_3() { return &sys_config_3; } + +#include "esc_spindle.h" +ESCSpindle esc_spindle {SPINDLE_PWM_NUMBER, SPINDLE_ENABLE_OUTPUT_NUMBER, SPINDLE_DIRECTION_OUTPUT_NUMBER, SPINDLE_SPEED_CHANGE_PER_MS}; + +ToolHead *toolhead_for_tool(uint8_t tool) { + return &esc_spindle; +} /* * hardware_init() - lowest level hardware init @@ -46,7 +82,9 @@ void hardware_init() { board_hardware_init(); - return; + toolhead_for_tool(0)->init(); + spindle_set_toolhead(toolhead_for_tool(0)); + return; } /* @@ -65,12 +103,12 @@ stat_t hardware_periodic() void hw_hard_reset(void) { - Motate::System::reset(/*boootloader: */ false); // arg=0 resets the system + Motate::System::reset(/*bootloader: */ false); // arg=0 resets the system } void hw_flash_loader(void) { - Motate::System::reset(/*boootloader: */ true); // arg=1 erases FLASH and enters FLASH loader + Motate::System::reset(/*bootloader: */ true); // arg=1 erases FLASH and enters FLASH loader } /* @@ -85,7 +123,7 @@ void _get_id(char *id) char *p = id; const char *uuid = Motate::UUID; - Motate::strncpy(p, uuid, Motate::strlen(uuid)); + Motate::strncpy(p, uuid, Motate::strlen(uuid)+1); } /***** END OF SYSTEM FUNCTIONS *****/ @@ -124,7 +162,7 @@ stat_t hw_get_fbc(nvObj_t *nv) #undef settings_file_string2 #else ritorno(nv_copy_string(nv, "")); - #endif +#endif return (STAT_OK); } @@ -145,12 +183,14 @@ stat_t hw_get_id(nvObj_t *nv) /* * hw_flash() - invoke FLASH loader from command input */ + stat_t hw_flash(nvObj_t *nv) { hw_flash_loader(); return(STAT_OK); } + /*********************************************************************************** * TEXT MODE SUPPORT * Functions to print variables from the cfgArray table diff --git a/g2core/board/ArduinoDue/board_gpio.cpp b/g2core/board/ArduinoDue/board_gpio.cpp index 4daf011d..f3357f74 100644 --- a/g2core/board/ArduinoDue/board_gpio.cpp +++ b/g2core/board/ArduinoDue/board_gpio.cpp @@ -56,39 +56,39 @@ /**** Setup Actual Objects ****/ -gpioDigitalInputPin> din1 {DI1_MODE, 1}; -gpioDigitalInputPin> din2 {DI2_MODE, 2}; -gpioDigitalInputPin> din3 {DI3_MODE, 3}; -gpioDigitalInputPin> din4 {DI4_MODE, 4}; -gpioDigitalInputPin> din5 {DI5_MODE, 5}; -gpioDigitalInputPin> din6 {DI6_MODE, 6}; -gpioDigitalInputPin> din7 {DI7_MODE, 7}; -gpioDigitalInputPin> din8 {DI8_MODE, 8}; -gpioDigitalInputPin> din9 {DI9_MODE, 9}; -// gpioDigitalInputPin> din10 {DI10_MODE, 10}; -// gpioDigitalInputPin> din11 {DI11_MODE, 11}; -// gpioDigitalInputPin> din12 {DI12_MODE, 12}; +gpioDigitalInputPin> din1 {DI1_ENABLED, DI1_POLARITY, 1, DI1_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; +gpioDigitalInputPin> din2 {DI2_ENABLED, DI2_POLARITY, 2, DI2_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; +gpioDigitalInputPin> din3 {DI3_ENABLED, DI3_POLARITY, 3, DI3_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; +gpioDigitalInputPin> din4 {DI4_ENABLED, DI4_POLARITY, 4, DI4_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; +gpioDigitalInputPin> din5 {DI5_ENABLED, DI5_POLARITY, 5, DI5_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; +gpioDigitalInputPin> din6 {DI6_ENABLED, DI6_POLARITY, 6, DI6_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; +gpioDigitalInputPin> din7 {DI7_ENABLED, DI7_POLARITY, 7, DI7_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; +gpioDigitalInputPin> din8 {DI8_ENABLED, DI8_POLARITY, 8, DI8_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; +gpioDigitalInputPin> din9 {DI9_ENABLED, DI9_POLARITY, 9, DI9_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; +gpioDigitalInputPin> din10 {DI10_ENABLED, DI10_POLARITY, 10, DI10_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; +// gpioDigitalInputPin> din11 {DI11_ENABLED, DI11_POLARITY, 11, DI11_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; +// gpioDigitalInputPin> din12 {DI12_ENABLED, DI12_POLARITY, 12, DI12_EXTERNAL_NUMBER, Motate::kPinInterruptOnChange|Motate::kPinInterruptPriorityHigh}; -gpioDigitalOutputPin> dout1 { DO1_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout2 { DO2_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout3 { DO3_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout4 { DO4_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout5 { DO5_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout6 { DO6_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout7 { DO7_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout8 { DO8_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout9 { DO9_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout10 { DO10_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout11 { DO11_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout12 { DO12_MODE, (uint32_t)200000 }; -gpioDigitalOutputPin> dout13 { DO13_MODE, (uint32_t)200000 }; +gpioDigitalOutputPin> dout1 { DO1_ENABLED, DO1_POLARITY, DO1_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout2 { DO2_ENABLED, DO2_POLARITY, DO2_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout3 { DO3_ENABLED, DO3_POLARITY, DO3_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout4 { DO4_ENABLED, DO4_POLARITY, DO4_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout5 { DO5_ENABLED, DO5_POLARITY, DO5_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout6 { DO6_ENABLED, DO6_POLARITY, DO6_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout7 { DO7_ENABLED, DO7_POLARITY, DO7_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout8 { DO8_ENABLED, DO8_POLARITY, DO8_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout9 { DO9_ENABLED, DO9_POLARITY, DO9_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout10 { DO10_ENABLED, DO10_POLARITY, DO10_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout11 { DO11_ENABLED, DO11_POLARITY, DO11_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout12 { DO12_ENABLED, DO12_POLARITY, DO12_EXTERNAL_NUMBER, (uint32_t)200000 }; +gpioDigitalOutputPin> dout13 { DO13_ENABLED, DO13_POLARITY, DO13_EXTERNAL_NUMBER, (uint32_t)200000 }; /**** Setup Arrays - these are extern and MUST match the board_gpio.h ****/ gpioDigitalInput* const d_in[] = {&din1, &din2, &din3, &din4, &din5, &din6, &din7, &din8, &din9}; gpioDigitalOutput* const d_out[] = {&dout1, &dout2, &dout3, &dout4, &dout5, &dout6, &dout7, &dout8, &dout9, &dout10, &dout11, &dout12, &dout13}; // not yet used -// gpioAnalogInput* a_in[A_IN_CHANNELS]; + gpioAnalogInput* a_in[] = {}; // gpioAnalogOutput* a_out[A_OUT_CHANNELS]; /************************************************************************************ diff --git a/g2core/board/ArduinoDue/board_gpio.h b/g2core/board/ArduinoDue/board_gpio.h index 25a1cddc..b4418b99 100644 --- a/g2core/board/ArduinoDue/board_gpio.h +++ b/g2core/board/ArduinoDue/board_gpio.h @@ -29,19 +29,29 @@ #define BOARD_GPIO_H_ONCE // this file is included from the bottom of gpio.h, but we do this for completeness -#include "../../gpio.h" +#include "gpio.h" +#include "hardware.h" /* * GPIO defines */ //--- change as required for board and switch hardware ---// -#define D_IN_CHANNELS 9 // v9 // number of digital inputs supported -#define D_OUT_CHANNELS 13 // number of digital outputs supported -#define A_IN_CHANNELS 0 // number of analog inputs supported -#define A_OUT_CHANNELS 0 // number of analog outputs supported +#define D_IN_CHANNELS 10 // v9 number of digital inputs supported +#define D_OUT_CHANNELS 13 // number of digital outputs supported +#define A_IN_CHANNELS 0 // number of analog inputs supported +#define A_OUT_CHANNELS 0 // number of analog outputs supported -#define INPUT_LOCKOUT_MS 10 // milliseconds to go dead after input firing +#define INPUT_LOCKOUT_MS 10 // milliseconds to go dead after input firing + +// Setup spindle and coolant pin assignments +#define SPINDLE_ENABLE_OUTPUT_NUMBER 1 +#define SPINDLE_DIRECTION_OUTPUT_NUMBER 2 +#define SPINDLE_PWM_NUMBER 3 +#define MIST_ENABLE_OUTPUT_NUMBER 4 + +#define FLOOD_ENABLE_OUTPUT_NUMBER 0 +#define SECONDARY_PWM_OUTPUT_NUMBER 0 /* * The GPIO objects themselves - this must match up with board_gpio.cpp! @@ -68,7 +78,7 @@ extern gpioDigitalInputPin> din6; extern gpioDigitalInputPin> din7; extern gpioDigitalInputPin> din8; extern gpioDigitalInputPin> din9; -// extern gpioDigitalInputPin> din10; +extern gpioDigitalInputPin> din10; // extern gpioDigitalInputPin> din11; // extern gpioDigitalInputPin> din12; diff --git a/g2core/board/ArduinoDue/board_xio.cpp b/g2core/board/ArduinoDue/board_xio.cpp index c056fa13..4b43d9f2 100644 --- a/g2core/board/ArduinoDue/board_xio.cpp +++ b/g2core/board/ArduinoDue/board_xio.cpp @@ -74,6 +74,7 @@ void board_hardware_init(void) // called 1st #if XIO_HAS_USB // Init USB usb.attach(); // USB setup. Runs in "background" as the rest of this executes + usb.checkAndHandleVbusChange(); #endif // XIO_HAS_USB } diff --git a/g2core/board/ArduinoDue/board_xio.h b/g2core/board/ArduinoDue/board_xio.h index 5ab8cee5..56823836 100644 --- a/g2core/board/ArduinoDue/board_xio.h +++ b/g2core/board/ArduinoDue/board_xio.h @@ -38,10 +38,10 @@ #include "MotateUSBCDC.h" #if USB_SERIAL_PORTS_EXPOSED == 1 -typedef Motate::USBDevice< USBDeviceHardware, Motate::USBCDC > XIOUSBDevice_t; +typedef Motate::USBDevice< Motate::USBDeviceHardware, Motate::USBCDC > XIOUSBDevice_t; #endif #if USB_SERIAL_PORTS_EXPOSED == 2 -typedef Motate::USBDevice< USBDeviceHardware, Motate::USBCDC, Motate::USBCDC > XIOUSBDevice_t; +typedef Motate::USBDevice< Motate::USBDeviceHardware, Motate::USBCDC, Motate::USBCDC > XIOUSBDevice_t; #endif extern XIOUSBDevice_t usb; diff --git a/g2core/board/ArduinoDue/hardware.h b/g2core/board/ArduinoDue/hardware.h index 42fb07c0..feab952b 100644 --- a/g2core/board/ArduinoDue/hardware.h +++ b/g2core/board/ArduinoDue/hardware.h @@ -46,13 +46,13 @@ #define MOTORS 4 // number of motors supported the hardware #define PWMS 2 // number of PWM channels supported the hardware +#define AXES 6 // axes to support -- must be 6 or 9 /************************* * Global System Defines * *************************/ #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) -#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16) #define SYS_ID_LEN 40 // total length including dashes and NUL /************************* @@ -61,6 +61,7 @@ #include "MotatePins.h" #include "MotateTimers.h" // for TimerChanel<> and related... +#include "MotateUtilities.h" // for TimerChanel<> and related... using Motate::TimerChannel; @@ -100,27 +101,25 @@ using Motate::OutputPin; /**** Stepper DDA and dwell timer settings ****/ -//#define FREQUENCY_DDA 200000UL // Hz step frequency. Interrupts actually fire at 2x (400 KHz) -#define FREQUENCY_DDA 150000UL // Hz step frequency. Interrupts actually fire at 2x (300 KHz) -#define FREQUENCY_DWELL 1000UL +#define FREQUENCY_DDA 100000UL // Hz step frequency. Interrupts actually fire at 2x (200 KHz) +#define FREQUENCY_DWELL 1000UL +#define MIN_SEGMENT_MS ((float)1.0) + +#define PLANNER_QUEUE_SIZE (48) +#define SECONDARY_QUEUE_SIZE (10) /**** Motate Definitions ****/ // Timer definitions. See stepper.h and other headers for setup -typedef TimerChannel<3,0> dda_timer_type; // stepper pulse generation in stepper.cpp -typedef TimerChannel<4,0> exec_timer_type; // request exec timer in stepper.cpp -typedef TimerChannel<5,0> fwd_plan_timer_type; // request exec timer in stepper.cpp +typedef TimerChannel<3,0> dda_timer_type; // stepper pulse generation in stepper.cpp +typedef TimerChannel<4,0> exec_timer_type; // request exec timer in stepper.cpp +typedef TimerChannel<5,0> fwd_plan_timer_type; // request exec timer in stepper.cpp // Pin assignments pin_number indicator_led_pin_num = Motate::kLED_USBRXPinNumber; static PWMOutputPin IndicatorLed; -// Init these to input to keep them high-z -static Pin spi_miso_pin(Motate::kInput); -static Pin spi_mosi_pin(Motate::kInput); -static Pin spi_sck_pin(Motate::kInput); - /**** Motate Global Pin Allocations ****/ //static OutputPin spi_ss1_pin; @@ -136,13 +135,6 @@ static OutputPin grbl_feedhold_pin; static OutputPin grbl_cycle_start_pin; static OutputPin motor_common_enable_pin; -static OutputPin spindle_enable_pin; -static OutputPin spindle_dir_pin; - -// NOTE: In the v9 and the Due the flood and mist coolants are mapped to a the same pin -//static OutputPin coolant_enable_pin; -static OutputPin flood_enable_pin; -static OutputPin mist_enable_pin; // Input pins are defined in gpio.cpp @@ -150,8 +142,10 @@ static OutputPin mist_enable_pin; * Function Prototypes (Common) * ********************************/ -void hardware_init(void); // master hardware init -stat_t hardware_periodic(); // callback from the main loop (time sensitive) +const configSubtable *const getSysConfig_3(); + +void hardware_init(void); // master hardware init +stat_t hardware_periodic(); // callback from the main loop (time sensitive) void hw_hard_reset(void); stat_t hw_flash(nvObj_t *nv); diff --git a/g2core/settings/settings_shapeoko2.h b/g2core/settings/settings_shapeoko2.h index 11e00258..c51f805f 100644 --- a/g2core/settings/settings_shapeoko2.h +++ b/g2core/settings/settings_shapeoko2.h @@ -47,6 +47,7 @@ #define SPINDLE_DIR_POLARITY 0 // 0=clockwise is low, 1=clockwise is high #define SPINDLE_PAUSE_ON_HOLD true #define SPINDLE_SPINUP_DELAY 1.0 +#define SPINDLE_SPEED_CHANGE_PER_MS 7.0 #define COOLANT_MIST_POLARITY 1 // 0=active low, 1=active high #define COOLANT_FLOOD_POLARITY 1 // 0=active low, 1=active high @@ -156,70 +157,91 @@ #define Z_LATCH_BACKOFF 4 #define Z_ZERO_BACKOFF 2 -//*** Input / output settings *** -/* - IO_MODE_DISABLED +/* Legend of valid options: + +INPUTS +--------------------- + DIn_ENABLED + IO_UNAVAILABLE // input/output is missing/used/unavailable + IO_DISABLED // input/output is disabled + IO_ENABLED // input/output enabled + + DIn_POLARITY: IO_ACTIVE_LOW aka NORMALLY_OPEN IO_ACTIVE_HIGH aka NORMALLY_CLOSED + DIn_ACTION: INPUT_ACTION_NONE - INPUT_ACTION_STOP - INPUT_ACTION_FAST_STOP - INPUT_ACTION_HALT - INPUT_ACTION_RESET + INPUT_ACTION_STOP - stop at normal jerk - preserves positional accuracy + INPUT_ACTION_FAST_STOP - stop at high jerk - preserves positional accuracy + INPUT_ACTION_HALT - stop immediately - not guaranteed to preserve position + INPUT_ACTION_CYCLE_START - start / restart cycle after feedhold (RESERVED) + INPUT_ACTION_ALARM - initiate an alarm. stops everything immediately - preserves position + INPUT_ACTION_SHUTDOWN - initiate a shutdown. stops everything immediately - does not preserve position + INPUT_ACTION_PANIC - initiate a panic. stops everything immediately - does not preserve position + INPUT_ACTION_RESET - reset system + + INPUT_ACTION_LIMIT - limit switch processing + INPUT_ACTION_INTERLOCK - interlock processing + +OUTPUTS +--------------------- + DOn_ENABLED + IO_UNAVAILABLE // input/output is missing/used/unavailable + IO_DISABLED // input/output is disabled + IO_ENABLED // input/output enabled + + DOn_POLARITY: + IO_ACTIVE_LOW aka NORMALLY_OPEN + IO_ACTIVE_HIGH aka NORMALLY_CLOSED - INPUT_FUNCTION_NONE - INPUT_FUNCTION_LIMIT - INPUT_FUNCTION_INTERLOCK - INPUT_FUNCTION_SHUTDOWN - INPUT_FUNCTION_PANIC */ // Xmin on v9 board -#define DI1_MODE NORMALLY_CLOSED +#define DI1_ENABLED IO_ENABLED +#define DI1_POLARITY NORMALLY_CLOSED //#define DI1_ACTION INPUT_ACTION_STOP -#define DI1_ACTION INPUT_ACTION_NONE -#define DI1_FUNCTION INPUT_FUNCTION_LIMIT +#define DI1_ACTION INPUT_ACTION_LIMIT // Xmax -#define DI2_MODE NORMALLY_CLOSED +#define DI2_ENABLED IO_ENABLED +#define DI2_POLARITY NORMALLY_CLOSED //#define DI2_ACTION INPUT_ACTION_STOP -#define DI2_ACTION INPUT_ACTION_NONE -#define DI2_FUNCTION INPUT_FUNCTION_LIMIT +#define DI2_ACTION INPUT_ACTION_LIMIT // Ymin -#define DI3_MODE NORMALLY_CLOSED +#define DI3_ENABLED IO_ENABLED +#define DI3_POLARITY NORMALLY_CLOSED //#define DI3_ACTION INPUT_ACTION_STOP -#define DI3_ACTION INPUT_ACTION_NONE -#define DI3_FUNCTION INPUT_FUNCTION_LIMIT +#define DI3_ACTION INPUT_ACTION_LIMIT // Ymax -#define DI4_MODE NORMALLY_CLOSED +#define DI4_ENABLED IO_ENABLED +#define DI4_POLARITY NORMALLY_CLOSED //#define DI4_ACTION INPUT_ACTION_STOP -#define DI4_ACTION INPUT_ACTION_NONE -#define DI4_FUNCTION INPUT_FUNCTION_LIMIT +#define DI4_ACTION INPUT_ACTION_LIMIT // Zmin -#define DI5_MODE IO_ACTIVE_HIGH // Z probe +#define DI5_ENABLED IO_ENABLED +#define DI5_POLARITY IO_ACTIVE_HIGH // Z probe #define DI5_ACTION INPUT_ACTION_NONE -#define DI5_FUNCTION INPUT_FUNCTION_NONE // Zmax -#define DI6_MODE NORMALLY_CLOSED +#define DI6_ENABLED IO_ENABLED +#define DI6_POLARITY NORMALLY_CLOSED //#define DI6_ACTION INPUT_ACTION_STOP -#define DI6_ACTION INPUT_ACTION_NONE -#define DI6_FUNCTION INPUT_FUNCTION_LIMIT +#define DI6_ACTION INPUT_ACTION_LIMIT // Amin -#define DI7_MODE IO_MODE_DISABLED +#define DI7_ENABLED IO_DISABLED +#define DI7_POLARITY IO_ACTIVE_LOW #define DI7_ACTION INPUT_ACTION_NONE -#define DI7_FUNCTION INPUT_FUNCTION_NONE // Amax -#define DI8_MODE IO_MODE_DISABLED +#define DI8_ENABLED IO_DISABLED +#define DI8_POLARITY IO_ACTIVE_LOW #define DI8_ACTION INPUT_ACTION_NONE -#define DI8_FUNCTION INPUT_FUNCTION_NONE // Hardware interlock input -#define DI9_MODE IO_MODE_DISABLED +#define DI9_ENABLED IO_DISABLED +#define DI9_POLARITY IO_ACTIVE_LOW #define DI9_ACTION INPUT_ACTION_NONE -#define DI9_FUNCTION INPUT_FUNCTION_NONE