Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
47b90b39
Commit
47b90b39
authored
Feb 16, 2016
by
MagoKimbra
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'refs/remotes/origin/master' into dev
parents
cb9daa6b
3a7dea0b
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
172 additions
and
56 deletions
+172
-56
MK_Main.cpp
MK/module/MK_Main.cpp
+18
-16
MK_Main.h
MK/module/MK_Main.h
+9
-9
dogm_lcd_implementation.h
MK/module/lcd/dogm_lcd_implementation.h
+12
-7
ultralcd.cpp
MK/module/lcd/ultralcd.cpp
+1
-1
ultralcd_implementation_hitachi_HD44780.h
MK/module/lcd/ultralcd_implementation_hitachi_HD44780.h
+114
-7
macros.h
MK/module/macros.h
+2
-0
stepper.cpp
MK/module/motion/stepper.cpp
+4
-4
stepper_indirection.h
MK/module/motion/stepper_indirection.h
+6
-6
Nextion_lcd.cpp
MK/module/nextion/Nextion_lcd.cpp
+6
-6
No files found.
MK/module/MK_Main.cpp
View file @
47b90b39
...
...
@@ -50,7 +50,8 @@ uint8_t debugLevel = DEBUG_ERRORS;
static
float
feedrate
=
1500.0
,
saved_feedrate
;
float
current_position
[
NUM_AXIS
]
=
{
0.0
};
float
destination
[
NUM_AXIS
]
=
{
0.0
};
bool
axis_known_position
[
3
]
=
{
false
};
uint8_t
axis_known_position
=
0
;
uint8_t
axis_was_homed
=
0
;
bool
pos_saved
=
false
;
float
stored_position
[
NUM_POSITON_SLOTS
][
NUM_AXIS
];
...
...
@@ -913,6 +914,7 @@ void get_command() {
bool
code_has_value
()
{
int
i
=
1
;
char
c
=
seen_pointer
[
i
];
while
(
c
==
' '
)
c
=
seen_pointer
[
++
i
];
if
(
c
==
'-'
||
c
==
'+'
)
c
=
seen_pointer
[
++
i
];
if
(
c
==
'.'
)
c
=
seen_pointer
[
++
i
];
return
(
c
>=
'0'
&&
c
<=
'9'
);
...
...
@@ -1358,7 +1360,7 @@ static void clean_up_after_endstop_move() {
#if HAS(SERVO_ENDSTOPS) && HASNT(Z_PROBE_SLED)
void
raise_z_for_servo
()
{
float
zpos
=
current_position
[
Z_AXIS
],
z_dest
=
Z_RAISE_BEFORE_PROBING
;
z_dest
+=
axis_known_position
[
Z_AXIS
]
?
zprobe_zoffset
:
zpos
;
z_dest
+=
TEST
(
axis_was_homed
,
Z_AXIS
)
?
zprobe_zoffset
:
zpos
;
if
(
zpos
<
z_dest
)
do_blocking_move_to_z
(
z_dest
);
// also updates current_position
}
#endif
...
...
@@ -1480,7 +1482,8 @@ static void clean_up_after_endstop_move() {
destination
[
axis
]
=
current_position
[
axis
];
feedrate
=
0.0
;
endstops_hit_on_purpose
();
// clear endstop hit flags
axis_known_position
[
axis
]
=
true
;
BITSET
(
axis_was_homed
,
axis
);
BITSET
(
axis_known_position
,
axis
);
#if ENABLED(Z_PROBE_SLED)
// bring probe back
...
...
@@ -1589,7 +1592,8 @@ static void clean_up_after_endstop_move() {
destination
[
axis
]
=
current_position
[
axis
];
feedrate
=
0.0
;
endstops_hit_on_purpose
();
// clear endstop hit flags
axis_known_position
[
axis
]
=
true
;
BITSET
(
axis_was_homed
,
axis
);
BITSET
(
axis_known_position
,
axis
);
}
}
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
...
...
@@ -2534,9 +2538,9 @@ static void clean_up_after_endstop_move() {
void
gcode_get_mix
()
{
const
char
*
mixing_codes
=
"ABCDHI"
;
float
mix_total
=
0.0
;
for
(
int8_t
e
=
0
;
e
<
DRIVER_EXTRUDERS
;
e
++
)
{
float
v
=
code_seen
(
mixing_codes
[
e
])
?
code_value
()
:
mixing_factor
[
e
];
mixing_factor
[
e
]
=
v
;
for
(
int8_t
i
=
0
;
i
<
DRIVER_EXTRUDERS
;
i
++
)
{
float
v
=
code_seen
(
mixing_codes
[
i
])
?
code_value
()
:
mixing_factor
[
i
];
mixing_factor
[
i
]
=
v
;
mix_total
+=
v
;
}
...
...
@@ -2544,8 +2548,8 @@ static void clean_up_after_endstop_move() {
if
(
mix_total
<
0.9999
||
mix_total
>
1.0001
)
{
ECHO_EM
(
"Warning: Mix factors must add up to 1.0. Scaling."
);
float
mix_scale
=
1.0
/
mix_total
;
for
(
int8_t
e
=
0
;
e
<
DRIVER_EXTRUDERS
;
e
++
)
mixing_factor
[
e
]
*=
mix_scale
;
for
(
int8_t
i
=
0
;
i
<
DRIVER_EXTRUDERS
;
i
++
)
mixing_factor
[
i
]
*=
mix_scale
;
}
}
#endif
...
...
@@ -2587,7 +2591,6 @@ static void clean_up_after_endstop_move() {
set_destination_to_current
();
if
(
retracting
)
{
feedrate
=
retract_feedrate
*
60
;
current_position
[
E_AXIS
]
+=
(
swapping
?
retract_length_swap
:
retract_length
)
/
volumetric_multiplier
[
active_extruder
];
plan_set_e_position
(
current_position
[
E_AXIS
]);
...
...
@@ -2604,7 +2607,6 @@ static void clean_up_after_endstop_move() {
}
}
else
{
if
(
retract_zlift
>
0.01
)
{
current_position
[
Z_AXIS
]
+=
retract_zlift
;
#if MECH(DELTA) || MECH(SCARA)
...
...
@@ -2644,7 +2646,7 @@ static void clean_up_after_endstop_move() {
if
(
debugLevel
&
DEBUG_INFO
)
ECHO_LMV
(
INFO
,
"dock_sled"
,
dock
);
if
(
!
axis_known_position
[
X_AXIS
]
||
!
axis_known_position
[
Y_AXIS
]
)
{
if
(
axis_known_position
&
(
BIT
(
X_AXIS
)
|
BIT
(
Y_AXIS
))
!=
BIT
(
X_AXIS
)
|
BIT
(
Y_AXIS
)
)
{
LCD_MESSAGEPGM
(
MSG_POSITION_UNKNOWN
);
ECHO_LM
(
DB
,
MSG_POSITION_UNKNOWN
);
return
;
...
...
@@ -3303,7 +3305,7 @@ inline void gcode_G28() {
else
if
(
homeZ
)
{
// Don't need to Home Z twice
// Let's see if X and Y are homed
if
(
axis_
known_position
[
X_AXIS
]
&&
axis_known_position
[
Y_AXIS
]
)
{
if
(
axis_
was_homed
&
(
BIT
(
X_AXIS
)
|
BIT
(
Y_AXIS
))
==
BIT
(
X_AXIS
)
|
BIT
(
Y_AXIS
)
)
{
// Make sure the probe is within the physical limits
// NOTE: This doesn't necessarily ensure the probe is also within the bed!
...
...
@@ -3348,7 +3350,7 @@ inline void gcode_G28() {
if
(
home_all_axis
||
homeZ
)
{
// Let's see if X and Y are homed
if
(
axis_
known_position
[
X_AXIS
]
&&
axis_known_position
[
Y_AXIS
]
)
{
if
(
axis_
was_homed
&
(
BIT
(
X_AXIS
)
|
BIT
(
Y_AXIS
))
==
BIT
(
X_AXIS
)
|
BIT
(
Y_AXIS
)
)
{
current_position
[
Z_AXIS
]
=
0
;
sync_plan_position
();
...
...
@@ -3477,7 +3479,7 @@ inline void gcode_G28() {
ECHO_LM
(
INFO
,
"gcode_G29 >>>"
);
// Don't allow auto-leveling without homing first
if
(
!
axis_known_position
[
X_AXIS
]
||
!
axis_known_position
[
Y_AXIS
]
)
{
if
(
axis_known_position
&
(
BIT
(
X_AXIS
)
|
BIT
(
Y_AXIS
))
!=
BIT
(
X_AXIS
)
|
BIT
(
Y_AXIS
)
)
{
LCD_MESSAGEPGM
(
MSG_POSITION_UNKNOWN
);
ECHO_LM
(
ER
,
MSG_POSITION_UNKNOWN
);
return
;
...
...
@@ -6151,7 +6153,7 @@ inline void gcode_M428() {
memcpy
(
new_pos
,
current_position
,
sizeof
(
new_pos
));
memcpy
(
new_offs
,
home_offset
,
sizeof
(
new_offs
));
for
(
int8_t
i
=
X_AXIS
;
i
<=
Z_AXIS
;
i
++
)
{
if
(
axis_known_position
[
i
]
)
{
if
(
TEST
(
axis_known_position
,
i
)
)
{
#if MECH(DELTA)
float
base
=
(
new_pos
[
i
]
>
(
min_pos
[
i
]
+
max_pos
[
i
])
/
2
)
?
base_home_pos
[
i
]
:
0
,
#else
...
...
MK/module/MK_Main.h
View file @
47b90b39
...
...
@@ -103,6 +103,11 @@ extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional
extern
float
current_position
[
NUM_AXIS
];
extern
float
destination
[
NUM_AXIS
];
extern
float
home_offset
[
3
];
extern
float
min_pos
[
3
];
extern
float
max_pos
[
3
];
extern
float
zprobe_zoffset
;
extern
uint8_t
axis_known_position
;
extern
uint8_t
axis_was_homed
;
// Hotend offset
#if HOTENDS > 1
...
...
@@ -132,11 +137,6 @@ extern float home_offset[3];
extern
float
axis_scaling
[
3
];
// Build size scaling
#endif
extern
float
min_pos
[
3
];
extern
float
max_pos
[
3
];
extern
bool
axis_known_position
[
3
];
extern
float
zprobe_zoffset
;
// Lifetime stats
extern
unsigned
long
printer_usage_seconds
;
// this can old about 136 year before go overflow. If you belive that you can live more than this please contact me.
// Filament stats
...
...
MK/module/lcd/dogm_lcd_implementation.h
View file @
47b90b39
...
...
@@ -354,7 +354,9 @@ static void lcd_implementation_status_screen() {
lcd_printPGM
(
PSTR
(
"---"
));
}
// X, Y, Z-Coordinates
// Print XYZ Coordinates
// If the axis was not homed, show "---"
// If the position is untrusted, show "?"
#define XYZ_BASELINE 38
lcd_setFont
(
FONT_STATUSMENU
);
...
...
@@ -364,30 +366,33 @@ static void lcd_implementation_status_screen() {
u8g
.
drawBox
(
0
,
30
,
LCD_PIXEL_WIDTH
,
9
);
#endif
u8g
.
setColorIndex
(
0
);
// white on black
u8g
.
setPrintPos
(
2
,
XYZ_BASELINE
);
lcd_print
(
'X
'
);
lcd_print
(
TEST
(
axis_known_position
,
X_AXIS
)
||
!
TEST
(
axis_was_homed
,
X_AXIS
)
?
'X'
:
'?
'
);
u8g
.
drawPixel
(
8
,
XYZ_BASELINE
-
5
);
u8g
.
drawPixel
(
8
,
XYZ_BASELINE
-
3
);
u8g
.
setPrintPos
(
10
,
XYZ_BASELINE
);
if
(
axis_known_position
[
X_AXIS
]
)
if
(
TEST
(
axis_was_homed
,
X_AXIS
)
)
lcd_print
(
ftostr31ns
(
current_position
[
X_AXIS
]));
else
lcd_printPGM
(
PSTR
(
"---"
));
u8g
.
setPrintPos
(
43
,
XYZ_BASELINE
);
lcd_print
(
'Y
'
);
lcd_print
(
TEST
(
axis_known_position
,
Y_AXIS
)
||
!
TEST
(
axis_was_homed
,
Y_AXIS
)
?
'Y'
:
'?
'
);
u8g
.
drawPixel
(
49
,
XYZ_BASELINE
-
5
);
u8g
.
drawPixel
(
49
,
XYZ_BASELINE
-
3
);
u8g
.
setPrintPos
(
51
,
XYZ_BASELINE
);
if
(
axis_known_position
[
Y_AXIS
]
)
if
(
TEST
(
axis_was_homed
,
Y_AXIS
)
)
lcd_print
(
ftostr31ns
(
current_position
[
Y_AXIS
]));
else
lcd_printPGM
(
PSTR
(
"---"
));
u8g
.
setPrintPos
(
83
,
XYZ_BASELINE
);
lcd_print
(
'Z
'
);
lcd_print
(
TEST
(
axis_known_position
,
Z_AXIS
)
||
!
TEST
(
axis_was_homed
,
Z_AXIS
)
?
'Z'
:
'?
'
);
u8g
.
drawPixel
(
89
,
XYZ_BASELINE
-
5
);
u8g
.
drawPixel
(
89
,
XYZ_BASELINE
-
3
);
u8g
.
setPrintPos
(
91
,
XYZ_BASELINE
);
if
(
axis_known_position
[
Z_AXIS
]
)
if
(
TEST
(
axis_was_homed
,
Z_AXIS
)
)
lcd_print
(
ftostr32sp
(
current_position
[
Z_AXIS
]));
else
lcd_printPGM
(
PSTR
(
"---.--"
));
...
...
MK/module/lcd/ultralcd.cpp
View file @
47b90b39
...
...
@@ -839,7 +839,7 @@ static void lcd_prepare_menu() {
// Level Bed
//
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
if
(
axis_known_position
[
X_AXIS
]
&&
axis_known_position
[
Y_AXIS
])
if
(
axis_known_position
&
(
BIT
(
X_AXIS
)
|
BIT
(
Y_AXIS
))
==
BIT
(
X_AXIS
)
|
BIT
(
Y_AXIS
))
{
MENU_ITEM
(
gcode
,
MSG_LEVEL_BED
,
PSTR
(
"G29"
));
#elif !MECH(DELTA) && DISABLED(Z_SAFE_HOMING) && Z_HOME_DIR < 0
MENU_ITEM
(
submenu
,
MSG_MBL_SETTING
,
config_lcd_level_bed
);
...
...
MK/module/lcd/ultralcd_implementation_hitachi_HD44780.h
View file @
47b90b39
...
...
@@ -236,6 +236,11 @@
#include "utf_mapper.h"
#if ENABLED(SHOW_BOOTSCREEN)
static
void
bootscreen
();
static
bool
show_bootscreen
=
true
;
#endif
#if ENABLED(LCD_PROGRESS_BAR)
static
millis_t
progress_bar_ms
=
0
;
#if PROGRESS_MSG_EXPIRE > 0
...
...
@@ -425,6 +430,10 @@ static void lcd_implementation_init(
lcd
.
begin
(
LCD_WIDTH
,
LCD_HEIGHT
);
#endif
#if ENABLED(SHOW_BOOTSCREEN)
if
(
show_bootscreen
)
bootscreen
();
#endif
lcd_set_custom_characters
(
#if ENABLED(LCD_PROGRESS_BAR)
progress_bar_set
...
...
@@ -452,6 +461,98 @@ char lcd_print(char* str) {
unsigned
lcd_print
(
char
c
)
{
return
charset_mapper
(
c
);
}
#if ENABLED(SHOW_BOOTSCREEN)
void
lcd_erase_line
(
int
line
)
{
lcd
.
setCursor
(
0
,
3
);
for
(
int
i
=
0
;
i
<
LCD_WIDTH
;
i
++
)
lcd_print
(
' '
);
}
// Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
void
lcd_scroll
(
int
col
,
int
line
,
const
char
*
text
,
int
len
,
int
time
)
{
char
tmp
[
LCD_WIDTH
+
1
]
=
{
0
};
int
n
=
max
(
lcd_strlen_P
(
text
)
-
len
,
0
);
for
(
int
i
=
0
;
i
<=
n
;
i
++
)
{
strncpy_P
(
tmp
,
text
+
i
,
min
(
len
,
LCD_WIDTH
));
lcd
.
setCursor
(
col
,
line
);
lcd_print
(
tmp
);
delay
(
time
/
max
(
n
,
1
));
}
}
static
void
bootscreen
()
{
show_bootscreen
=
false
;
byte
top_left
[
8
]
=
{
B00000
,
B00000
,
B00000
,
B00000
,
B00001
,
B00010
,
B00100
,
B00100
};
byte
top_right
[
8
]
=
{
B00000
,
B00000
,
B00000
,
B11100
,
B11100
,
B01100
,
B00100
,
B00100
};
byte
botom_left
[
8
]
=
{
B00100
,
B00010
,
B00001
,
B00000
,
B00000
,
B00000
,
B00000
,
B00000
};
byte
botom_right
[
8
]
=
{
B00100
,
B01000
,
B10000
,
B00000
,
B00000
,
B00000
,
B00000
,
B00000
};
lcd
.
createChar
(
0
,
top_left
);
lcd
.
createChar
(
1
,
top_right
);
lcd
.
createChar
(
2
,
botom_left
);
lcd
.
createChar
(
3
,
botom_right
);
lcd
.
clear
();
#define TEXT_SCREEN_LOGO_SHIFT ((LCD_WIDTH/2) - 7)
lcd
.
setCursor
(
TEXT_SCREEN_LOGO_SHIFT
,
0
);
lcd
.
print
(
'\x00'
);
lcd_printPGM
(
PSTR
(
"------------"
));
lcd
.
print
(
'\x01'
);
lcd
.
setCursor
(
TEXT_SCREEN_LOGO_SHIFT
,
1
);
lcd_printPGM
(
PSTR
(
"|MarlinKimbra|"
));
lcd
.
setCursor
(
TEXT_SCREEN_LOGO_SHIFT
,
2
);
lcd
.
print
(
'\x02'
);
lcd_printPGM
(
PSTR
(
"------------"
));
lcd
.
print
(
'\x03'
);
delay
(
1000
);
#ifdef STRING_SPLASH_LINE1
lcd_erase_line
(
3
);
lcd_scroll
(
0
,
3
,
PSTR
(
STRING_SPLASH_LINE1
),
LCD_WIDTH
,
3000
);
#endif
#ifdef STRING_SPLASH_LINE2
lcd_erase_line
(
3
);
lcd_scroll
(
0
,
3
,
PSTR
(
STRING_SPLASH_LINE2
),
LCD_WIDTH
,
3000
);
#endif
#ifdef FIRMWARE_URL
lcd_erase_line
(
3
);
lcd_scroll
(
0
,
3
,
PSTR
(
FIRMWARE_URL
),
LCD_WIDTH
,
5000
);
#endif
}
#endif // SHOW_BOOTSCREEN
/*
Possible status screens:
16x2 |000/000 B000/000|
...
...
@@ -561,6 +662,12 @@ static void lcd_implementation_status_screen() {
lcd
.
setCursor
(
0
,
1
);
//
// Print XYZ Coordinates
// If the axis was not homed, show "---"
// If the position is untrusted, show "?"
//
#if HOTENDS > 1 && TEMP_SENSOR_BED != 0
// If we both have a 2nd hotend and a heated bed,
...
...
@@ -570,14 +677,14 @@ static void lcd_implementation_status_screen() {
#else
lcd
.
print
(
'X
'
);
if
(
axis_known_position
[
X_AXIS
]
)
lcd
.
print
(
TEST
(
axis_known_position
,
X_AXIS
)
||
!
TEST
(
axis_was_homed
,
X_AXIS
)
?
'X'
:
'?
'
);
if
(
TEST
(
axis_was_homed
,
X_AXIS
)
)
lcd
.
print
(
ftostr4sign
(
current_position
[
X_AXIS
]));
else
lcd_printPGM
(
PSTR
(
" ---"
));
lcd_printPGM
(
PSTR
(
" Y
"
));
if
(
axis_known_position
[
Y_AXIS
]
)
lcd_printPGM
(
TEST
(
axis_known_position
,
Y_AXIS
)
||
!
TEST
(
axis_was_homed
,
Y_AXIS
)
?
PSTR
(
" Y"
)
:
PSTR
(
" ?
"
));
if
(
TEST
(
axis_was_homed
,
Y_AXIS
)
)
lcd
.
print
(
ftostr4sign
(
current_position
[
Y_AXIS
]));
else
lcd_printPGM
(
PSTR
(
" ---"
));
...
...
@@ -587,8 +694,8 @@ static void lcd_implementation_status_screen() {
#endif // LCD_WIDTH >= 20
lcd
.
setCursor
(
LCD_WIDTH
-
8
,
1
);
lcd_printPGM
(
PSTR
(
"Z
"
));
if
(
axis_known_position
[
Z_AXIS
]
)
lcd_printPGM
(
TEST
(
axis_known_position
,
Z_AXIS
)
||
!
TEST
(
axis_was_homed
,
Z_AXIS
)
?
PSTR
(
"Z "
)
:
PSTR
(
"?
"
));
if
(
TEST
(
axis_was_homed
,
Z_AXIS
)
)
lcd
.
print
(
ftostr32sp
(
current_position
[
Z_AXIS
]
+
0
.
00001
));
else
lcd_printPGM
(
PSTR
(
"---.--"
));
...
...
MK/module/macros.h
View file @
47b90b39
...
...
@@ -7,6 +7,8 @@
// Macros for bit masks
#define BIT(b) (1<<(b))
#define TEST(n,b) (((n)&BIT(b))!=0)
#define BITSET(n,b) n |= BIT(b)
#define BITCLR(n,b) n &= ~BIT(b)
#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (BIT(b))
// Macros for maths shortcuts
...
...
MK/module/motion/stepper.cpp
View file @
47b90b39
...
...
@@ -696,7 +696,7 @@ ISR(TIMER1_COMPA_vect) {
#if ENABLED(COLOR_MIXING_EXTRUDER)
long
dir
=
TEST
(
out_bits
,
E_AXIS
)
?
-
1
:
1
;
for
(
u
int8_t
j
=
0
;
j
<
DRIVER_EXTRUDERS
;
j
++
)
{
for
(
int8_t
j
=
0
;
j
<
DRIVER_EXTRUDERS
;
j
++
)
{
counter_m
[
j
]
+=
current_block
->
mix_steps
[
j
];
if
(
counter_m
[
j
]
>
0
)
{
counter_m
[
j
]
-=
current_block
->
step_event_count
;
...
...
MK/module/motion/stepper_indirection.h
View file @
47b90b39
...
...
@@ -180,10 +180,10 @@
#if ENABLED(DUAL_X_CARRIAGE) && HAS(X_ENABLE) && HAS(X2_ENABLE)
#define enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0)
#define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON);
axis_known_position[X_AXIS] = false
; } while (0)
#define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON);
BITCLR(axis_known_position, X_AXIS)
; } while (0)
#elif HAS(X_ENABLE)
#define enable_x() X_ENABLE_WRITE( X_ENABLE_ON)
#define disable_x() { X_ENABLE_WRITE(!X_ENABLE_ON);
axis_known_position[X_AXIS] = false
; }
#define disable_x() { X_ENABLE_WRITE(!X_ENABLE_ON);
BITCLR(axis_known_position, X_AXIS)
; }
#else
#define enable_x() ;
#define disable_x() ;
...
...
@@ -192,10 +192,10 @@
#if HAS(Y_ENABLE)
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
#define enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }
#define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON);
axis_known_position[Y_AXIS] = false
; }
#define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON);
BITCLR(axis_known_position, Y_AXIS)
; }
#else
#define enable_y() Y_ENABLE_WRITE( Y_ENABLE_ON)
#define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON);
axis_known_position[Y_AXIS] = false
; }
#define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON);
BITCLR(axis_known_position, Y_AXIS)
; }
#endif
#else
#define enable_y() ;
...
...
@@ -205,10 +205,10 @@
#if HAS(Z_ENABLE)
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
#define enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }
#define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON);
axis_known_position[Z_AXIS] = false
; }
#define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON);
BITCLR(axis_known_position, Z_AXIS)
; }
#else
#define enable_z() Z_ENABLE_WRITE( Z_ENABLE_ON)
#define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON);
axis_known_position[Z_AXIS] = false
; }
#define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON);
BITCLR(axis_known_position, Z_AXIS)
; }
#endif
#else
#define enable_z() ;
...
...
MK/module/nextion/Nextion_lcd.cpp
View file @
47b90b39
...
...
@@ -528,24 +528,24 @@
char
*
valuetemp
;
memset
(
buffer
,
0
,
sizeof
(
buffer
));
strcat
(
buffer
,
"X
"
);
if
(
axis_known_position
[
X_AXIS
]
)
{
strcat
(
buffer
,
TEST
(
axis_known_position
,
X_AXIS
)
||
!
TEST
(
axis_was_homed
,
X_AXIS
)
?
"X"
:
"?
"
);
if
(
TEST
(
axis_was_homed
,
X_AXIS
)
)
{
valuetemp
=
ftostr4sign
(
current_position
[
X_AXIS
]);
strcat
(
buffer
,
valuetemp
);
}
else
strcat
(
buffer
,
"---"
);
strcat
(
buffer
,
" Y"
);
if
(
axis_known_position
[
Y_AXIS
]
)
{
strcat
(
buffer
,
TEST
(
axis_known_position
,
Y_AXIS
)
||
!
TEST
(
axis_was_homed
,
Y_AXIS
)
?
PSTR
(
" Y"
)
:
PSTR
(
" ?"
)
);
if
(
TEST
(
axis_was_homed
,
Y_AXIS
)
)
{
valuetemp
=
ftostr4sign
(
current_position
[
Y_AXIS
]);
strcat
(
buffer
,
valuetemp
);
}
else
strcat
(
buffer
,
"---"
);
strcat
(
buffer
,
" Z"
);
if
(
axis_known_position
[
Z_AXIS
]
)
{
strcat
(
buffer
,
TEST
(
axis_known_position
,
Z_AXIS
)
||
!
TEST
(
axis_was_homed
,
Z_AXIS
)
?
PSTR
(
"Z "
)
:
PSTR
(
"? "
)
);
if
(
TEST
(
axis_was_homed
,
Z_AXIS
)
)
{
valuetemp
=
ftostr32sp
(
current_position
[
Z_AXIS
]
+
0.00001
);
strcat
(
buffer
,
valuetemp
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment