Commit 91ba54ae authored by MagoKimbra's avatar MagoKimbra

Add firmware test

parent 1f257b0a
...@@ -5932,28 +5932,30 @@ void setPwmFrequency(uint8_t pin, int val) ...@@ -5932,28 +5932,30 @@ void setPwmFrequency(uint8_t pin, int val)
#ifdef FIRMWARE_TEST #ifdef FIRMWARE_TEST
void FirmwareTest(){ void FirmwareTest(){
SERIAL_ECHO_START; SERIAL_ECHOLN("---------- FIRMWARE TEST --------------");
SERIAL_ECHOLN("INIZIO FIRMWARE TEST"); SERIAL_ECHOLN("--------- by MarlinKimbra -------------");
SERIAL_ECHOLN("Posizionare manualmente gli assi X, Y e z lontano dagli endstop"); SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("Dare il comando Y per andare avanti"); SERIAL_ECHOLN(MSG_FWTEST_01);
SERIAL_ECHOLN(MSG_FWTEST_YES);
serial_char = MYSERIAL.read(); serial_char = MYSERIAL.read();
while(serial_char!='Y'){ while(serial_char!='Y'){
serial_char = MYSERIAL.read(); serial_char = MYSERIAL.read();
} }
SERIAL_ECHOLN("Inizio controllo ENDSTOP"); SERIAL_ECHOLN(MSG_FWTEST_02);
SERIAL_ECHOLN(" "); SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("***** ENDSTOP X *****"); SERIAL_ECHOLN("***** ENDSTOP X *****");
#if defined(X_MIN_PIN) && X_MIN_PIN > -1 && X_HOME_DIR == -1 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 && X_HOME_DIR == -1
if (!READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ if (!READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP X APERTO"); SERIAL_ECHO("MIN ENDSTOP X: ");
#elif defined(X_MAX_PIN) && X_MAX_PIN > -1 && X_HOME_DIR == 1 #elif defined(X_MAX_PIN) && X_MAX_PIN > -1 && X_HOME_DIR == 1
if (!READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ if (!READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP X APERTO"); SERIAL_ECHO("MAX ENDSTOP X: ");
#endif #endif
SERIAL_ECHOLN(MSG_ENDSTOP_OPEN);
} }
else else
{ {
SERIAL_ECHOLN("Endstop X ERR"); SERIAL_ECHOLN("X ENDSTOP ERROR");
#if X_HOME_DIR == -1 #if X_HOME_DIR == -1
SERIAL_ECHOLN("Invertire valore in #define X_MIN_ENDSTOP_INVERTING"); SERIAL_ECHOLN("Invertire valore in #define X_MIN_ENDSTOP_INVERTING");
#else #else
...@@ -5962,37 +5964,40 @@ void FirmwareTest(){ ...@@ -5962,37 +5964,40 @@ void FirmwareTest(){
return; return;
} }
SERIAL_ECHOLN("Premere e tenere premuto l'endstop X."); SERIAL_ECHOLN("Premere e tenere premuto l'endstop X.");
SERIAL_ECHOLN("Dare il comando Y per andare avanti"); SERIAL_ECHOLN(MSG_FWTEST_YES);
serial_char = MYSERIAL.read(); serial_char = MYSERIAL.read();
while(serial_char!='Y'){ while(serial_char!='Y'){
serial_char = MYSERIAL.read(); serial_char = MYSERIAL.read();
} }
#if defined(X_MIN_PIN) && X_MIN_PIN > -1 && X_HOME_DIR == -1 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 && X_HOME_DIR == -1
if (READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ if (READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP X CHIUSO"); SERIAL_ECHO("MIN ENDSTOP X: ");
#elif defined(X_MAX_PIN) && X_MAX_PIN > -1 && X_HOME_DIR == 1 #elif defined(X_MAX_PIN) && X_MAX_PIN > -1 && X_HOME_DIR == 1
if (READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ if (READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP X CHIUSO"); SERIAL_ECHO("MAX ENDSTOP X: ");
#endif #endif
SERIAL_ECHOLN(MSG_ENDSTOP_HIT);
} }
else else
{ {
SERIAL_ECHOLN("Endstop X ERR! Controllare cavi e connessioni"); SERIAL_ECHO("X ");
SERIAL_ECHOLN(MSG_FWTEST_ENDSTOP_ERR);
return; return;
} }
SERIAL_ECHOLN(" "); SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("***** ENDSTOP Y *****"); SERIAL_ECHOLN("***** ENDSTOP Y *****");
#if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 && Y_HOME_DIR == -1 #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 && Y_HOME_DIR == -1
if (!READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ if (!READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP Y APERTO"); SERIAL_ECHO("MIN ENDSTOP Y: ");
#elif defined(Y_MAX_PIN) && Y_MAX_PIN > -1 && Y_HOME_DIR == 1 #elif defined(Y_MAX_PIN) && Y_MAX_PIN > -1 && Y_HOME_DIR == 1
if (!READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ if (!READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP Y APERTO"); SERIAL_ECHO("MAX ENDSTOP Y: ");
#endif #endif
SERIAL_ECHOLN(MSG_ENDSTOP_OPEN);
} }
else else
{ {
SERIAL_ECHOLN("Endstop Y ERR"); SERIAL_ECHOLN("Y ENDSTOP ERROR");
#if Y_HOME_DIR == -1 #if Y_HOME_DIR == -1
SERIAL_ECHOLN("Invertire valore in #define Y_MIN_ENDSTOP_INVERTING"); SERIAL_ECHOLN("Invertire valore in #define Y_MIN_ENDSTOP_INVERTING");
#else #else
...@@ -6001,37 +6006,40 @@ void FirmwareTest(){ ...@@ -6001,37 +6006,40 @@ void FirmwareTest(){
return; return;
} }
SERIAL_ECHOLN("Premere e tenere premuto l'endstop Y."); SERIAL_ECHOLN("Premere e tenere premuto l'endstop Y.");
SERIAL_ECHOLN("Dare il comando Y per andare avanti"); SERIAL_ECHOLN(MSG_FWTEST_YES);
serial_char = MYSERIAL.read(); serial_char = MYSERIAL.read();
while(serial_char!='Y'){ while(serial_char!='Y'){
serial_char = MYSERIAL.read(); serial_char = MYSERIAL.read();
} }
#if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 && Y_HOME_DIR == -1 #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 && Y_HOME_DIR == -1
if (READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ if (READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP Y CHIUSO"); SERIAL_ECHO("MIN ENDSTOP Y: ");
#elif defined(Y_MAX_PIN) && Y_MAX_PIN > -1 && Y_HOME_DIR == 1 #elif defined(Y_MAX_PIN) && Y_MAX_PIN > -1 && Y_HOME_DIR == 1
if (READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ if (READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP Y CHIUSO"); SERIAL_ECHO("MAX ENDSTOP Y: ");
#endif #endif
SERIAL_ECHOLN(MSG_ENDSTOP_HIT);
} }
else else
{ {
SERIAL_ECHOLN("Endstop Y ERR! Controllare cavi e connessioni"); SERIAL_ECHO("Y ");
SERIAL_ECHOLN(MSG_FWTEST_ENDSTOP_ERR);
return; return;
} }
SERIAL_ECHOLN(" "); SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("***** ENDSTOP Z *****"); SERIAL_ECHOLN("***** ENDSTOP Z *****");
#if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 && Z_HOME_DIR == -1 #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 && Z_HOME_DIR == -1
if (!READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ if (!READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP Z APERTO"); SERIAL_ECHO("MIN ENDSTOP Z: ");
#elif defined(Z_MAX_PIN) && Z_MAX_PIN > -1 && Z_HOME_DIR == 1 #elif defined(Z_MAX_PIN) && Z_MAX_PIN > -1 && Z_HOME_DIR == 1
if (!READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ if (!READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP Z APERTO"); SERIAL_ECHO("MAX ENDSTOP Z: ");
#endif #endif
SERIAL_ECHOLN(MSG_ENDSTOP_OPEN);
} }
else else
{ {
SERIAL_ECHOLN("Endstop Z ERR"); SERIAL_ECHOLN("Z ENDSTOP ERROR");
#if Z_HOME_DIR == -1 #if Z_HOME_DIR == -1
SERIAL_ECHOLN("Invertire valore in #define Z_MIN_ENDSTOP_INVERTING"); SERIAL_ECHOLN("Invertire valore in #define Z_MIN_ENDSTOP_INVERTING");
#else #else
...@@ -6040,27 +6048,29 @@ void FirmwareTest(){ ...@@ -6040,27 +6048,29 @@ void FirmwareTest(){
return; return;
} }
SERIAL_ECHOLN("Premere e tenere premuto l'endstop Z."); SERIAL_ECHOLN("Premere e tenere premuto l'endstop Z.");
SERIAL_ECHOLN("Dare il comando Y per andare avanti"); SERIAL_ECHOLN(MSG_FWTEST_YES);
serial_char = MYSERIAL.read(); serial_char = MYSERIAL.read();
while(serial_char!='Y'){ while(serial_char!='Y'){
serial_char = MYSERIAL.read(); serial_char = MYSERIAL.read();
} }
#if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 && Z_HOME_DIR == -1 #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 && Z_HOME_DIR == -1
if (READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ if (READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP Z CHIUSO"); SERIAL_ECHO("MIN ENDSTOP Z: ");
#elif defined(Z_MAX_PIN) && Z_MAX_PIN > -1 && Z_HOME_DIR == 1 #elif defined(Z_MAX_PIN) && Z_MAX_PIN > -1 && Z_HOME_DIR == 1
if (READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ if (READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP Z CHIUSO"); SERIAL_ECHO("MAX ENDSTOP Z: ");
#endif #endif
SERIAL_ECHOLN(MSG_ENDSTOP_HIT);
} }
else else
{ {
SERIAL_ECHOLN("Endstop Z ERR! Controllare cavi e connessioni"); SERIAL_ECHO("Z ");
SERIAL_ECHOLN(MSG_FWTEST_ENDSTOP_ERR);
return; return;
} }
SERIAL_ECHOLN("ENDSTOP OK"); SERIAL_ECHOLN("ENDSTOP OK");
SERIAL_ECHOLN(" "); SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("TEST MOTORI SOON"); SERIAL_ECHOLN("TEST MOTOR SOON");
serial_char = MYSERIAL.read(); serial_char = MYSERIAL.read();
} }
#endif //FIRMWARE_TEST #endif //FIRMWARE_TEST
......
...@@ -113,13 +113,11 @@ ...@@ -113,13 +113,11 @@
#define MSG_Y_MAX "y_max: " #define MSG_Y_MAX "y_max: "
#define MSG_Z_MIN "z_min: " #define MSG_Z_MIN "z_min: "
#define MSG_Z_MAX "z_max: " #define MSG_Z_MAX "z_max: "
#ifdef NPR2
#define MSG_E_MIN "e_min: " #define MSG_E_MIN "e_min: "
#endif // MPR2
#define MSG_M119_REPORT "Reporting endstop status" #define MSG_M119_REPORT "Reporting endstop status"
#define MSG_ENDSTOP_HIT "TRIGGERED" #define MSG_ENDSTOP_HIT "TRIGGERED"
#define MSG_ENDSTOP_OPEN "open" #define MSG_ENDSTOP_OPEN "OPEN"
#define MSG_HOTEND_OFFSET "Hotend offsets:" #define MSG_HOTEND_OFFSET "Hotend offsets:"
#define MSG_EMPTY_PLANE "Autolevel can only be execute on an actual plane, make sure width and height are not 0!" #define MSG_EMPTY_PLANE "Autolevel can only be execute on an actual plane, make sure width and height are not 0!"
...@@ -286,6 +284,14 @@ ...@@ -286,6 +284,14 @@
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
#ifdef FIRMWARE_TEST
#define MSG_FWTEST_YES "Put the Y command to go forward"
#define MSG_FWTEST_NO "Put the N command to go forward"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_01 "Manually move the axes X, Y and Z away from the endstop"
#define MSG_FWTEST_02 "Start check ENDSTOP"
#endif
#endif #endif
...@@ -1093,6 +1099,14 @@ ...@@ -1093,6 +1099,14 @@
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
#ifdef FIRMWARE_TEST
#define MSG_FWTEST_YES "Dai il comando Y per andare avanti"
#define MSG_FWTEST_NO "Dai il comando N per andare avanti"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Controllare cavi e connessioni"
#define MSG_FWTEST_01 "Muovi manualmente gli assi X, Y e Z lontano dagli endstop"
#define MSG_FWTEST_02 "Inizio controllo ENDSTOP"
#endif // FIRMWARE_TEST
#endif #endif
......
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