Browse Source

LED Switch and minor config update

pull/38/head
X-Dron 4 years ago
parent
commit
a6fea31697
  1. 2
      Marlin/Configuration.h
  2. 6
      Marlin/Configuration_adv.h
  3. 23
      Marlin/src/MarlinCore.cpp
  4. 7
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h
  5. 7
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h

2
Marlin/Configuration.h

@ -1162,7 +1162,7 @@
// Travel limits (mm) after homing, corresponding to endstop positions. // Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS 0 #define X_MIN_POS 0
#define Y_MIN_POS -4 #define Y_MIN_POS -2
#define Z_MIN_POS 0 #define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE + X_MIN_POS #define X_MAX_POS X_BED_SIZE + X_MIN_POS
#define Y_MAX_POS Y_BED_SIZE + Y_MIN_POS #define Y_MAX_POS Y_BED_SIZE + Y_MIN_POS

6
Marlin/Configuration_adv.h

@ -1612,9 +1612,9 @@
#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). #define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement).
//#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA! //#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA!
#define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way #define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way
//#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps #define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps
#define BABYSTEP_MULTIPLICATOR_Z 10 // (steps or mm) Steps or millimeter distance for each Z babystep #define BABYSTEP_MULTIPLICATOR_Z 0.01 // (steps or mm) Steps or millimeter distance for each Z babystep
#define BABYSTEP_MULTIPLICATOR_XY 10 // (steps or mm) Steps or millimeter distance for each XY babystep //#define BABYSTEP_MULTIPLICATOR_XY 10 // (steps or mm) Steps or millimeter distance for each XY babystep
#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)

23
Marlin/src/MarlinCore.cpp

@ -268,6 +268,11 @@ bool wait_for_heatup = true;
* ******************************** FUNCTIONS ******************************** * ******************************** FUNCTIONS ********************************
* *************************************************************************** * ***************************************************************************
*/ */
#ifdef LED_SW_PIN
void setup_LED_SW_pin() {
SET_INPUT_PULLDOWN(LED_SW_PIN);
}
#endif
void setup_killpin() { void setup_killpin() {
#if HAS_KILL #if HAS_KILL
@ -559,6 +564,20 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
} }
#endif #endif
#ifdef LED_SW_PIN
static int LedSw_Count = 0; // make the inactivity button a bit less responsive
const int LED_SW_DELAY = 100;
bool led_pin_status = !READ(LED_SW_PIN);
if (led_pin_status && LedSw_Count <= LED_SW_DELAY)
LedSw_Count++;
else if (!led_pin_status)
LedSw_Count = 0;
if (LedSw_Count == LED_SW_DELAY){
caselight.on = !caselight.on;
caselight.update(true);
}
#endif
#if HAS_HOME #if HAS_HOME
// Handle a standalone HOME button // Handle a standalone HOME button
constexpr millis_t HOME_DEBOUNCE_DELAY = 1000UL; constexpr millis_t HOME_DEBOUNCE_DELAY = 1000UL;
@ -1002,6 +1021,10 @@ void setup() {
SETUP_RUN(setup_killpin()); SETUP_RUN(setup_killpin());
#ifdef LED_SW_PIN
SETUP_RUN(setup_LED_SW_pin());
#endif
#if HAS_TMC220x #if HAS_TMC220x
SETUP_RUN(tmc_serial_begin()); SETUP_RUN(tmc_serial_begin());
#endif #endif

7
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h

@ -168,7 +168,12 @@ BlTouch
//#define POWER_LOSS_PIN PA2 // PW_DET //#define POWER_LOSS_PIN PA2 // PW_DET
//#define PS_ON_PIN PB2 // PW_OFF //#define PS_ON_PIN PB2 // PW_OFF
#define FIL_RUNOUT_PIN PA4 #define FIL_RUNOUT_PIN PA4
#define FIL_RUNOUT2_PIN PE6 #ifdef CASE_LED_INSTEAD_E1
//#define LED_SW_PIN PE6
#endif
#ifndef LED_SW_PIN
#define FIL_RUNOUT2_PIN PE6
#endif
#endif #endif
// //

7
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h

@ -236,7 +236,12 @@ https://easyeda.com/sst78rust/fb4s-led-control
//#define POWER_LOSS_PIN PA2 // PW_DET //#define POWER_LOSS_PIN PA2 // PW_DET
//#define PS_ON_PIN PB2 // PW_OFF //#define PS_ON_PIN PB2 // PW_OFF
#define FIL_RUNOUT_PIN PA4 #define FIL_RUNOUT_PIN PA4
#define FIL_RUNOUT2_PIN PE6 #ifdef CASE_LED_INSTEAD_E1
#define LED_SW_PIN PE6
#endif
#ifndef LED_SW_PIN
#define FIL_RUNOUT2_PIN PE6
#endif
#endif #endif
#define SERVO0_PIN PA8 // Enable BLTOUCH #define SERVO0_PIN PA8 // Enable BLTOUCH

Loading…
Cancel
Save