Commit 63ef2d1c authored by MagoKimbra's avatar MagoKimbra

Fix

Nextion GFX for DELTA
parent d11d187d
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
#define BOARD_DUEMILANOVE_328P 4 // Duemilanove w/ ATMega328P pin assignments #define BOARD_DUEMILANOVE_328P 4 // Duemilanove w/ ATMega328P pin assignments
#define BOARD_MKS_BASE 40 // MKS BASE 1.0 #define BOARD_MKS_BASE 40 // MKS BASE 1.0
#define BOARD_MKS_MINI 41 // MKS MINI 1.0 #define BOARD_MKS_MINI 41 // MKS MINI 1.0
#define BOARD_RADDS 402 // RADDS ARM 32 #define BOARD_RADDS 401 // RADDS ARM 32
#define BOARD_RAMPS_FD_V1 403 // RAMPS-FD V1 ARM 32 #define BOARD_RAMPS_FD_V1 403 // RAMPS-FD V1 ARM 32
#define BOARD_RAMPS_FD_V2 404 // RAMPS-FD V2 ARM 32 #define BOARD_RAMPS_FD_V2 404 // RAMPS-FD V2 ARM 32
#define BOARD_SMART_RAMPS 408 // SMART RAMPS ARM 32 #define BOARD_SMART_RAMPS 408 // SMART RAMPS ARM 32
......
...@@ -2875,11 +2875,18 @@ void gcode_get_destination() { ...@@ -2875,11 +2875,18 @@ void gcode_get_destination() {
#endif #endif
#if ENABLED(NEXTION) && ENABLED(NEXTION_GFX) #if ENABLED(NEXTION) && ENABLED(NEXTION_GFX)
#if MECH(DELTA)
if((code_seen(axis_codes[X_AXIS]) || code_seen(axis_codes[Y_AXIS])) && code_seen(axis_codes[E_AXIS]))
gfx_line_to(destination[X_AXIS] + (X_MAX_POS), destination[Y_AXIS] + (Y_MAX_POS), destination[Z_AXIS]);
else
gfx_cursor_to(destination[X_AXIS] + (X_MAX_POS), destination[Y_AXIS] + (Y_MAX_POS), destination[Z_AXIS]);
#else
if((code_seen(axis_codes[X_AXIS]) || code_seen(axis_codes[Y_AXIS])) && code_seen(axis_codes[E_AXIS])) if((code_seen(axis_codes[X_AXIS]) || code_seen(axis_codes[Y_AXIS])) && code_seen(axis_codes[E_AXIS]))
gfx_line_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]); gfx_line_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]);
else else
gfx_cursor_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]); gfx_cursor_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]);
#endif #endif
#endif
} }
void unknown_command_error() { void unknown_command_error() {
...@@ -3230,7 +3237,7 @@ inline void gcode_G28() { ...@@ -3230,7 +3237,7 @@ inline void gcode_G28() {
sync_plan_position(); sync_plan_position();
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_MIN_POS + 5); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], (Z_MIN_POS) + 5);
// PROBE FIRST POINT // PROBE FIRST POINT
set_pageShowInfo(1); set_pageShowInfo(1);
...@@ -3242,43 +3249,43 @@ inline void gcode_G28() { ...@@ -3242,43 +3249,43 @@ inline void gcode_G28() {
// PROBE SECOND POINT // PROBE SECOND POINT
set_pageShowInfo(2); set_pageShowInfo(2);
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS],Z_MIN_POS + 5); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], (Z_MIN_POS) + 5);
do_blocking_move_to(RIGHT_PROBE_BED_POSITION, FRONT_PROBE_BED_POSITION, current_position[Z_AXIS]); do_blocking_move_to(RIGHT_PROBE_BED_POSITION, FRONT_PROBE_BED_POSITION, current_position[Z_AXIS]);
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS],Z_MIN_POS); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_MIN_POS);
while(!lcd_clicked()) { while(!lcd_clicked()) {
idle(true); idle(true);
} }
// PROBE THIRD POINT // PROBE THIRD POINT
set_pageShowInfo(3); set_pageShowInfo(3);
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS],Z_MIN_POS + 5); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], (Z_MIN_POS) + 5);
do_blocking_move_to(RIGHT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION, current_position[Z_AXIS]); do_blocking_move_to(RIGHT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION, current_position[Z_AXIS]);
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS],Z_MIN_POS); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_MIN_POS);
while(!lcd_clicked()) { while(!lcd_clicked()) {
idle(true); idle(true);
} }
// PROBE FOURTH POINT // PROBE FOURTH POINT
set_pageShowInfo(4); set_pageShowInfo(4);
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS],Z_MIN_POS + 5); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], (Z_MIN_POS) + 5);
do_blocking_move_to(LEFT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION, current_position[Z_AXIS]); do_blocking_move_to(LEFT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION, current_position[Z_AXIS]);
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS],Z_MIN_POS); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_MIN_POS);
while(!lcd_clicked()) { while(!lcd_clicked()) {
idle(true); idle(true);
} }
// PROBE CENTER // PROBE CENTER
set_pageShowInfo(5); set_pageShowInfo(5);
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS],Z_MIN_POS + 5); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], (Z_MIN_POS) + 5);
do_blocking_move_to((X_MAX_POS-X_MIN_POS)/2, (Y_MAX_POS-Y_MIN_POS)/2, current_position[Z_AXIS]); do_blocking_move_to(((X_MAX_POS) - (X_MIN_POS)) / 2, ((Y_MAX_POS) - (Y_MIN_POS)) / 2, current_position[Z_AXIS]);
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS],Z_MIN_POS); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_MIN_POS);
while(!lcd_clicked()) { while(!lcd_clicked()) {
idle(true); idle(true);
} }
// FINISH MANUAL BED LEVEL // FINISH MANUAL BED LEVEL
set_pageShowInfo(6); set_pageShowInfo(6);
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS],Z_MIN_POS + 5); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], (Z_MIN_POS) + 5);
enqueuecommands_P(PSTR("G28")); enqueuecommands_P(PSTR("G28"));
#endif // ULTIPANEL #endif // ULTIPANEL
} }
...@@ -3441,9 +3448,14 @@ inline void gcode_G28() { ...@@ -3441,9 +3448,14 @@ inline void gcode_G28() {
} }
#if ENABLED(NEXTION) && ENABLED(NEXTION_GFX) #if ENABLED(NEXTION) && ENABLED(NEXTION_GFX)
#if MECH(DELTA)
gfx_clear((X_MAX_POS) * 2, (Y_MAX_POS) * 2, Z_MAX_POS);
gfx_cursor_to(current_position[X_AXIS] + (X_MAX_POS), current_position[Y_AXIS] + (Y_MAX_POS), current_position[Z_AXIS]);
#else
gfx_clear(X_MAX_POS, Y_MAX_POS, Z_MAX_POS); gfx_clear(X_MAX_POS, Y_MAX_POS, Z_MAX_POS);
gfx_cursor_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); gfx_cursor_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]);
#endif #endif
#endif
if (debugLevel & DEBUG_INFO) ECHO_LM(INFO, "<<< gcode_G28"); if (debugLevel & DEBUG_INFO) ECHO_LM(INFO, "<<< gcode_G28");
} }
......
...@@ -463,7 +463,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); } ...@@ -463,7 +463,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); }
#if ENABLED(SHOW_BOOTSCREEN) #if ENABLED(SHOW_BOOTSCREEN)
void lcd_erase_line(int line) { void lcd_erase_line(int line) {
lcd.setCursor(0, 3); lcd.setCursor(0, line);
for (int i = 0; i < LCD_WIDTH; i++) for (int i = 0; i < LCD_WIDTH; i++)
lcd_print(' '); lcd_print(' ');
} }
......
...@@ -572,11 +572,11 @@ void set_stepper_direction(bool onlye) { ...@@ -572,11 +572,11 @@ void set_stepper_direction(bool onlye) {
#define SET_STEP_DIR(AXIS) \ #define SET_STEP_DIR(AXIS) \
if (TEST(out_bits, AXIS ##_AXIS)) { \ if (TEST(out_bits, AXIS ##_AXIS)) { \
AXIS ##_APPLY_DIR(INVERT_## AXIS ##_DIR, 0); \ AXIS ##_APPLY_DIR(INVERT_## AXIS ##_DIR, false); \
count_direction[AXIS ##_AXIS] = -1; \ count_direction[AXIS ##_AXIS] = -1; \
} \ } \
else { \ else { \
AXIS ##_APPLY_DIR(!INVERT_## AXIS ##_DIR, 0); \ AXIS ##_APPLY_DIR(!INVERT_## AXIS ##_DIR, false); \
count_direction[AXIS ##_AXIS] = 1; \ count_direction[AXIS ##_AXIS] = 1; \
} }
......
...@@ -173,8 +173,12 @@ ...@@ -173,8 +173,12 @@
PageInfo = true; PageInfo = true;
#if ENABLED(NEXTION_GFX) #if ENABLED(NEXTION_GFX)
#if MECH(DELTA)
gfx_clear((X_MAX_POS) * 2, (Y_MAX_POS) * 2, Z_MAX_POS);
#else
gfx_clear(X_MAX_POS, Y_MAX_POS, Z_MAX_POS); gfx_clear(X_MAX_POS, Y_MAX_POS, Z_MAX_POS);
#endif #endif
#endif
#if HAS_TEMP_0 #if HAS_TEMP_0
Hotend.setValue(1); Hotend.setValue(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment