Commit 3cdc97a5 authored by MagoKimbra's avatar MagoKimbra

Add firmware test

M998 start firmware test. Use baudrate 115200 and arduino serial monitor
parent a87241b5
......@@ -4,7 +4,7 @@
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_VERSION_CONFIG_H __DATE__ " 11/10/2014 " __TIME__ // build date and time
#define STRING_VERSION_CONFIG_H __DATE__ " 23/10/2014 " __TIME__ // build date and time
#define STRING_CONFIG_H_AUTHOR "(MagoKimbra: magokimbra@hotmail.com, Version 4.0)" // Who made the changes.
// SERIAL_PORT selects which serial port should be used for communication with the host.
......@@ -41,6 +41,9 @@
// Advanced settings can be found in Configuration_adv.h
// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
// If you want test the firmware uncomment below. The command for run test is M998. Use Serial arduino monitor...
//#define FIRMWARE_TEST
/***********************************************************************\
**************************** Define type printer **********************
***********************************************************************/
......
......@@ -312,5 +312,9 @@ extern inline bool debugDryrun()
return ((debugLevel & 8)!=0);
}
#ifdef FIRMWARE_TEST
void FirmwareTest();
#endif
#endif
......@@ -5016,7 +5016,11 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
}
break;
#endif // NPR2
#ifdef FIRMWARE_TEST
case 998: // M998 Firmware test
FirmwareTest();
break;
#endif // FIRMWARE_TEST
case 999: // M999: Restart after being stopped
Stopped = false;
lcd_reset_alert_level();
......@@ -5928,6 +5932,141 @@ void setPwmFrequency(uint8_t pin, int val)
}
#endif //FAST_PWM_FAN
#ifdef FIRMWARE_TEST
void FirmwareTest(){
SERIAL_ECHO_START;
SERIAL_ECHOLN("INIZIO FIRMWARE TEST");
SERIAL_ECHOLN("Posizionare manualmente gli assi X, Y e z lontano dagli endstop");
SERIAL_ECHOLN("Dare il comando Y per andare avanti");
serial_char = MYSERIAL.read();
while(serial_char!='Y'){
serial_char = MYSERIAL.read();
}
SERIAL_ECHOLN("Inizio controllo ENDSTOP");
SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("***** ENDSTOP X *****");
#if defined(X_MIN_PIN) && X_MIN_PIN > -1 && X_HOME_DIR == -1
if (!READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP X APERTO");
#elif defined(X_MAX_PIN) && X_MAX_PIN > -1 && X_HOME_DIR == 1
if (!READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP X APERTO");
#endif
}
else
{
SERIAL_ECHOLN("Endstop X ERR");
#if X_HOME_DIR == -1
SERIAL_ECHOLN("Invertire valore in #define X_MIN_ENDSTOP_INVERTING");
#else
SERIAL_ECHOLN("Invertire valore in #define X_MAX_ENDSTOP_INVERTING");
#endif
return;
}
SERIAL_ECHOLN("Premere e tenere premuto l'endstop X.");
SERIAL_ECHOLN("Dare il comando Y per andare avanti");
serial_char = MYSERIAL.read();
while(serial_char!='Y'){
serial_char = MYSERIAL.read();
}
#if defined(X_MIN_PIN) && X_MIN_PIN > -1 && X_HOME_DIR == -1
if (READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP X CHIUSO");
#elif defined(X_MAX_PIN) && X_MAX_PIN > -1 && X_HOME_DIR == 1
if (READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP X CHIUSO");
#endif
}
else
{
SERIAL_ECHOLN("Endstop X ERR! Controllare cavi e connessioni");
return;
}
SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("***** ENDSTOP Y *****");
#if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 && Y_HOME_DIR == -1
if (!READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP Y APERTO");
#elif defined(Y_MAX_PIN) && Y_MAX_PIN > -1 && Y_HOME_DIR == 1
if (!READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP Y APERTO");
#endif
}
else
{
SERIAL_ECHOLN("Endstop Y ERR");
#if Y_HOME_DIR == -1
SERIAL_ECHOLN("Invertire valore in #define Y_MIN_ENDSTOP_INVERTING");
#else
SERIAL_ECHOLN("Invertire valore in #define Y_MAX_ENDSTOP_INVERTING");
#endif
return;
}
SERIAL_ECHOLN("Premere e tenere premuto l'endstop Y.");
SERIAL_ECHOLN("Dare il comando Y per andare avanti");
serial_char = MYSERIAL.read();
while(serial_char!='Y'){
serial_char = MYSERIAL.read();
}
#if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 && Y_HOME_DIR == -1
if (READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP Y CHIUSO");
#elif defined(Y_MAX_PIN) && Y_MAX_PIN > -1 && Y_HOME_DIR == 1
if (READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP Y CHIUSO");
#endif
}
else
{
SERIAL_ECHOLN("Endstop Y ERR! Controllare cavi e connessioni");
return;
}
SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("***** ENDSTOP Z *****");
#if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 && Z_HOME_DIR == -1
if (!READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP Z APERTO");
#elif defined(Z_MAX_PIN) && Z_MAX_PIN > -1 && Z_HOME_DIR == 1
if (!READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP Z APERTO");
#endif
}
else
{
SERIAL_ECHOLN("Endstop Z ERR");
#if Z_HOME_DIR == -1
SERIAL_ECHOLN("Invertire valore in #define Z_MIN_ENDSTOP_INVERTING");
#else
SERIAL_ECHOLN("Invertire valore in #define Z_MAX_ENDSTOP_INVERTING");
#endif
return;
}
SERIAL_ECHOLN("Premere e tenere premuto l'endstop Z.");
SERIAL_ECHOLN("Dare il comando Y per andare avanti");
serial_char = MYSERIAL.read();
while(serial_char!='Y'){
serial_char = MYSERIAL.read();
}
#if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 && Z_HOME_DIR == -1
if (READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MIN ENDSTOP Z CHIUSO");
#elif defined(Z_MAX_PIN) && Z_MAX_PIN > -1 && Z_HOME_DIR == 1
if (READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){
SERIAL_ECHOLN("MAX ENDSTOP Z CHIUSO");
#endif
}
else
{
SERIAL_ECHOLN("Endstop Z ERR! Controllare cavi e connessioni");
return;
}
SERIAL_ECHOLN("ENDSTOP OK");
SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("TEST MOTORI SOON");
serial_char = MYSERIAL.read();
}
#endif //FIRMWARE_TEST
bool setTargetedHotend(int code){
tmp_extruder = active_extruder;
if(code_seen('T')) {
......
......@@ -61,6 +61,7 @@ Features:
* Singlenozzle support
* NPr2 support, multiextruder by NicolaP http://www.3dmakerlab.it/extruder-npr2.html
* Laserbeam support
* Firmware test
The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
......@@ -182,6 +183,12 @@ Set distance to probe bed at for G30 function
* \#define BED_DIAMETER 170 // mm
M998 Firmware test tools
-----------------
Test firmware uncomment
* \#define FIRMWARE_TEST in configuration.h
Use baudrate 115200 and use Arduino serial monitor.
Implemented G Codes:
====================
......@@ -294,6 +301,7 @@ M Codes
* M350 - Set microstepping mode.
* M351 - Toggle MS1 MS2 pins directly.
* M928 - Start SD logging (M928 filename.g) - ended by M29
* M998 - Start tools firmware test
* M999 - Restart after being stopped by error
......
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