Skip to content

Commit

Permalink
INIT_CUSTOM_USER_BUTTON_PINS(N) macro and USER_GCODE_PIN_INIT_n remov…
Browse files Browse the repository at this point in the history
…ed; USER_GCODE_PIN_n will always be initiated
  • Loading branch information
MoellerDi committed Sep 26, 2020
1 parent d5899a2 commit 3652f24
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
5 changes: 0 additions & 5 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -3204,39 +3204,34 @@
#define USER_GCODE_1 "G28\nG29 W"
//#define USER_GCODE_PIN_1 -1 // PIN assigned to trigger USER_GCODE_1 execution
#ifdef USER_GCODE_PIN_1
#define USER_GCODE_PIN_INIT_1 // Init the PIN state at reboot
#define USER_GCODE_PIN_STATE_1 LOW // What state should trigger USER_GCODE_1 execution (LOW or HIGH)
#endif

#define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
//#define USER_GCODE_PIN_2 -1 // PIN assigned to trigger USER_GCODE_2 execution
#ifdef USER_GCODE_PIN_2
#define USER_GCODE_PIN_INIT_2 // Init the PIN state at reboot
#define USER_GCODE_PIN_STATE_2 LOW // What state should trigger USER_GCODE_2 execution (LOW or HIGH)
#endif

#define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
//#define USER_GCODE_PIN_3 -1 // PIN assigned to trigger USER_GCODE_3 execution
#ifdef USER_GCODE_PIN_3
#define USER_GCODE_PIN_INIT_3 // Init the PIN state at reboot
#define USER_GCODE_PIN_STATE_3 LOW // What state should trigger USER_GCODE_3 execution (LOW or HIGH)
#endif

#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_GCODE_PIN_4 -1 // PIN assigned to trigger USER_GCODE_4 execution
#ifdef USER_GCODE_PIN_4
#define USER_GCODE_PIN_INIT_4 // Init the PIN state at reboot
#define USER_GCODE_PIN_STATE_4 LOW // What state should trigger USER_GCODE_4 execution (LOW or HIGH)
#endif

#define USER_DESC_5 "Home & Info"
#define USER_GCODE_5 "G28\nM503"
//#define USER_GCODE_PIN_5 -1 // PIN assigned to trigger USER_GCODE_5 execution
#ifdef USER_GCODE_PIN_5
#define USER_GCODE_PIN_INIT_5 // Init the PIN state at reboot
#define USER_GCODE_PIN_STATE_5 LOW // What state should trigger USER_GCODE_5 execution (LOW or HIGH)
#endif
#endif
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,6 @@ void setup() {
#endif

#if HAS_CUSTOM_USER_BUTTONS
#define INIT_CUSTOM_USER_BUTTON_PINS(N) (PIN_EXISTS(USER_GCODE_PIN_##N) && ENABLED(USER_GCODE_PIN_INIT_##N) && defined(USER_GCODE_PIN_STATE_##N))
#define INIT_CUSTOM_USER_BUTTON_PIN(N) do{ SET_INPUT(USER_GCODE_PIN_##N); WRITE(USER_GCODE_PIN_##N, !USER_GCODE_PIN_STATE_##N); }while(0)

#if HAS_CUSTOM_USER_BUTTON(1)
Expand Down

0 comments on commit 3652f24

Please sign in to comment.