|
@ -37,7 +37,7 @@ |
|
|
|
|
|
|
|
|
#if ENABLED(MKS_TEST) |
|
|
#if ENABLED(MKS_TEST) |
|
|
|
|
|
|
|
|
#include "mks_hardware_test.h" |
|
|
#include "mks_hardware.h" |
|
|
|
|
|
|
|
|
bool pw_det_sta, pw_off_sta, mt_det_sta; |
|
|
bool pw_det_sta, pw_off_sta, mt_det_sta; |
|
|
#if PIN_EXISTS(MT_DET_2) |
|
|
#if PIN_EXISTS(MT_DET_2) |
|
@ -127,77 +127,81 @@ |
|
|
delay(100); |
|
|
delay(100); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void mks_gpio_test() { |
|
|
#if ENABLED(SDSUPPORT) |
|
|
init_test_gpio(); |
|
|
|
|
|
|
|
|
void mks_gpio_test() { |
|
|
test_gpio_readlevel_L(); |
|
|
init_test_gpio(); |
|
|
test_gpio_readlevel_H(); |
|
|
|
|
|
test_gpio_readlevel_L(); |
|
|
test_gpio_readlevel_L(); |
|
|
if (pw_det_sta && pw_off_sta && mt_det_sta |
|
|
test_gpio_readlevel_H(); |
|
|
#if PIN_EXISTS(MT_DET_2) |
|
|
test_gpio_readlevel_L(); |
|
|
&& mt_det2_sta |
|
|
if (pw_det_sta && pw_off_sta && mt_det_sta |
|
|
#endif |
|
|
#if PIN_EXISTS(MT_DET_2) |
|
|
#if ENABLED(MKS_HARDWARE_TEST_ONLY_E0) |
|
|
&& mt_det2_sta |
|
|
&& (READ(PA1) == LOW) |
|
|
#endif |
|
|
&& (READ(PA3) == LOW) |
|
|
#if ENABLED(MKS_HARDWARE_TEST_ONLY_E0) |
|
|
&& (READ(PC2) == LOW) |
|
|
&& (READ(PA1) == LOW) |
|
|
&& (READ(PD8) == LOW) |
|
|
&& (READ(PA3) == LOW) |
|
|
&& (READ(PE5) == LOW) |
|
|
&& (READ(PC2) == LOW) |
|
|
&& (READ(PE6) == LOW) |
|
|
&& (READ(PD8) == LOW) |
|
|
&& (READ(PE7) == LOW) |
|
|
&& (READ(PE5) == LOW) |
|
|
#endif |
|
|
&& (READ(PE6) == LOW) |
|
|
) |
|
|
&& (READ(PE7) == LOW) |
|
|
disp_det_ok(); |
|
|
#endif |
|
|
else |
|
|
) |
|
|
disp_det_error(); |
|
|
disp_det_ok(); |
|
|
|
|
|
else |
|
|
if (endstopx1_sta && endstopy1_sta && endstopz1_sta && endstopz2_sta) |
|
|
disp_det_error(); |
|
|
disp_Limit_ok(); |
|
|
|
|
|
else |
|
|
if (endstopx1_sta && endstopy1_sta && endstopz1_sta && endstopz2_sta) |
|
|
disp_Limit_error(); |
|
|
disp_Limit_ok(); |
|
|
} |
|
|
else |
|
|
|
|
|
disp_Limit_error(); |
|
|
void mks_hardware_test() { |
|
|
|
|
|
if (millis() % 2000 < 1000) { |
|
|
|
|
|
WRITE(X_DIR_PIN, LOW); |
|
|
|
|
|
WRITE(Y_DIR_PIN, LOW); |
|
|
|
|
|
WRITE(Z_DIR_PIN, LOW); |
|
|
|
|
|
WRITE(E0_DIR_PIN, LOW); |
|
|
|
|
|
#if DISABLED(MKS_HARDWARE_TEST_ONLY_E0) |
|
|
|
|
|
WRITE(E1_DIR_PIN, LOW); |
|
|
|
|
|
#endif |
|
|
|
|
|
thermalManager.fan_speed[0] = 255; |
|
|
|
|
|
#if DISABLED(MKS_HARDWARE_TEST_ONLY_E0) |
|
|
|
|
|
WRITE(HEATER_1_PIN, HIGH); // HE1
|
|
|
|
|
|
#endif |
|
|
|
|
|
WRITE(HEATER_0_PIN, HIGH); // HE0
|
|
|
|
|
|
WRITE(HEATER_BED_PIN, HIGH); // HOT-BED
|
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
WRITE(X_DIR_PIN, HIGH); |
|
|
|
|
|
WRITE(Y_DIR_PIN, HIGH); |
|
|
|
|
|
WRITE(Z_DIR_PIN, HIGH); |
|
|
|
|
|
WRITE(E0_DIR_PIN, HIGH); |
|
|
|
|
|
#if DISABLED(MKS_HARDWARE_TEST_ONLY_E0) |
|
|
|
|
|
WRITE(E1_DIR_PIN, HIGH); |
|
|
|
|
|
#endif |
|
|
|
|
|
thermalManager.fan_speed[0] = 0; |
|
|
|
|
|
#if DISABLED(MKS_HARDWARE_TEST_ONLY_E0) |
|
|
|
|
|
WRITE(HEATER_1_PIN, LOW); // HE1
|
|
|
|
|
|
#endif |
|
|
|
|
|
WRITE(HEATER_0_PIN, LOW); // HE0
|
|
|
|
|
|
WRITE(HEATER_BED_PIN, LOW); // HOT-BED
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (endstopx1_sta && endstopx2_sta && endstopy1_sta && endstopy2_sta && endstopz1_sta && endstopz2_sta) { |
|
|
void mks_hardware_test() { |
|
|
// nothing here
|
|
|
if (millis() % 2000 < 1000) { |
|
|
} |
|
|
WRITE(X_DIR_PIN, LOW); |
|
|
else { |
|
|
WRITE(Y_DIR_PIN, LOW); |
|
|
|
|
|
WRITE(Z_DIR_PIN, LOW); |
|
|
|
|
|
WRITE(E0_DIR_PIN, LOW); |
|
|
|
|
|
#if DISABLED(MKS_HARDWARE_TEST_ONLY_E0) |
|
|
|
|
|
WRITE(E1_DIR_PIN, LOW); |
|
|
|
|
|
#endif |
|
|
|
|
|
thermalManager.fan_speed[0] = 255; |
|
|
|
|
|
#if DISABLED(MKS_HARDWARE_TEST_ONLY_E0) |
|
|
|
|
|
WRITE(HEATER_1_PIN, HIGH); // HE1
|
|
|
|
|
|
#endif |
|
|
|
|
|
WRITE(HEATER_0_PIN, HIGH); // HE0
|
|
|
|
|
|
WRITE(HEATER_BED_PIN, HIGH); // HOT-BED
|
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
WRITE(X_DIR_PIN, HIGH); |
|
|
|
|
|
WRITE(Y_DIR_PIN, HIGH); |
|
|
|
|
|
WRITE(Z_DIR_PIN, HIGH); |
|
|
|
|
|
WRITE(E0_DIR_PIN, HIGH); |
|
|
|
|
|
#if DISABLED(MKS_HARDWARE_TEST_ONLY_E0) |
|
|
|
|
|
WRITE(E1_DIR_PIN, HIGH); |
|
|
|
|
|
#endif |
|
|
|
|
|
thermalManager.fan_speed[0] = 0; |
|
|
|
|
|
#if DISABLED(MKS_HARDWARE_TEST_ONLY_E0) |
|
|
|
|
|
WRITE(HEATER_1_PIN, LOW); // HE1
|
|
|
|
|
|
#endif |
|
|
|
|
|
WRITE(HEATER_0_PIN, LOW); // HE0
|
|
|
|
|
|
WRITE(HEATER_BED_PIN, LOW); // HOT-BED
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (endstopx1_sta && endstopx2_sta && endstopy1_sta && endstopy2_sta && endstopz1_sta && endstopz2_sta) { |
|
|
|
|
|
// nothing here
|
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (disp_state == PRINT_READY_UI) |
|
|
|
|
|
mks_disp_test(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (disp_state == PRINT_READY_UI) |
|
|
#endif |
|
|
mks_disp_test(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif // MKS_TEST
|
|
|
#endif // MKS_TEST
|
|
|
|
|
|
|
|
@ -613,10 +617,9 @@ void disp_assets_update_progress(const char *msg) { |
|
|
disp_string(100, 165, buf, 0xFFFF, 0x0000); |
|
|
disp_string(100, 165, buf, 0xFFFF, 0x0000); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uint8_t mks_test_flag = 0; |
|
|
#if BOTH(MKS_TEST, SDSUPPORT) |
|
|
const char *MKSTestPath = "MKS_TEST"; |
|
|
uint8_t mks_test_flag = 0; |
|
|
|
|
|
const char *MKSTestPath = "MKS_TEST"; |
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
|
|
void mks_test_get() { |
|
|
void mks_test_get() { |
|
|
SdFile dir, root = card.getroot(); |
|
|
SdFile dir, root = card.getroot(); |
|
|
if (dir.open(&root, MKSTestPath, O_RDONLY)) |
|
|
if (dir.open(&root, MKSTestPath, O_RDONLY)) |