Merge branch 'Marlin_v1' of https://github.com/ErikZalm/Marlin into Marlin_v1

This commit is contained in:
neildarlow 2014-05-24 13:08:58 +01:00
commit efb6d61413
4 changed files with 29 additions and 9 deletions

View File

@ -119,6 +119,7 @@
// M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating // M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
// Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling // Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
// IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F // IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
// M112 - Emergency stop
// M114 - Output current position to serial port // M114 - Output current position to serial port
// M115 - Capabilities string // M115 - Capabilities string
// M117 - display message // M117 - display message
@ -673,6 +674,11 @@ void get_command()
} }
} }
//If command was e-stop process now
if(strcmp(cmdbuffer[bufindw], "M112") == 0)
kill();
bufindw = (bufindw + 1)%BUFSIZE; bufindw = (bufindw + 1)%BUFSIZE;
buflen += 1; buflen += 1;
} }
@ -1177,19 +1183,21 @@ void process_commands()
//ClearToSend(); //ClearToSend();
return; return;
} }
//break; break;
case 2: // G2 - CW ARC case 2: // G2 - CW ARC
if(Stopped == false) { if(Stopped == false) {
get_arc_coordinates(); get_arc_coordinates();
prepare_arc_move(true); prepare_arc_move(true);
return; return;
} }
break;
case 3: // G3 - CCW ARC case 3: // G3 - CCW ARC
if(Stopped == false) { if(Stopped == false) {
get_arc_coordinates(); get_arc_coordinates();
prepare_arc_move(false); prepare_arc_move(false);
return; return;
} }
break;
case 4: // G4 dwell case 4: // G4 dwell
LCD_MESSAGEPGM(MSG_DWELL); LCD_MESSAGEPGM(MSG_DWELL);
codenum = 0; codenum = 0;
@ -1799,7 +1807,7 @@ void process_commands()
int pin_number = LED_PIN; int pin_number = LED_PIN;
if (code_seen('P') && pin_status >= 0 && pin_status <= 255) if (code_seen('P') && pin_status >= 0 && pin_status <= 255)
pin_number = code_value(); pin_number = code_value();
for(int8_t i = 0; i < (int8_t)sizeof(sensitive_pins); i++) for(int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins)/sizeof(int)); i++)
{ {
if (sensitive_pins[i] == pin_number) if (sensitive_pins[i] == pin_number)
{ {
@ -1830,6 +1838,9 @@ void process_commands()
#endif #endif
setWatch(); setWatch();
break; break;
case 112: // M112 -Emergency Stop
kill();
break;
case 140: // M140 set bed temp case 140: // M140 set bed temp
if (code_seen('S')) setTargetBed(code_value()); if (code_seen('S')) setTargetBed(code_value());
break; break;
@ -2153,8 +2164,9 @@ void process_commands()
} }
break; break;
case 85: // M85 case 85: // M85
code_seen('S'); if(code_seen('S')) {
max_inactive_time = code_value() * 1000; max_inactive_time = code_value() * 1000;
}
break; break;
case 92: // M92 case 92: // M92
for(int8_t i=0; i < NUM_AXIS; i++) for(int8_t i=0; i < NUM_AXIS; i++)
@ -2275,6 +2287,7 @@ void process_commands()
if(tmp_extruder >= EXTRUDERS) { if(tmp_extruder >= EXTRUDERS) {
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHO(MSG_M200_INVALID_EXTRUDER); SERIAL_ECHO(MSG_M200_INVALID_EXTRUDER);
break;
} }
} }
volumetric_multiplier[tmp_extruder] = 1 / area; volumetric_multiplier[tmp_extruder] = 1 / area;
@ -2466,7 +2479,7 @@ void process_commands()
if(pin_state >= -1 && pin_state <= 1){ if(pin_state >= -1 && pin_state <= 1){
for(int8_t i = 0; i < (int8_t)sizeof(sensitive_pins); i++) for(int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins)/sizeof(int)); i++)
{ {
if (sensitive_pins[i] == pin_number) if (sensitive_pins[i] == pin_number)
{ {
@ -3424,6 +3437,9 @@ void handle_status_leds(void) {
void manage_inactivity() void manage_inactivity()
{ {
if(buflen < (BUFSIZE-1))
get_command();
if( (millis() - previous_millis_cmd) > max_inactive_time ) if( (millis() - previous_millis_cmd) > max_inactive_time )
if(max_inactive_time) if(max_inactive_time)
kill(); kill();

View File

@ -179,7 +179,7 @@ void PID_autotune(float temp, int extruder, int ncycles)
float Kp, Ki, Kd; float Kp, Ki, Kd;
float max = 0, min = 10000; float max = 0, min = 10000;
if ((extruder > EXTRUDERS) if ((extruder >= EXTRUDERS)
#if (TEMP_BED_PIN <= -1) #if (TEMP_BED_PIN <= -1)
||(extruder < 0) ||(extruder < 0)
#endif #endif
@ -609,6 +609,7 @@ static float analog2temp(int raw, uint8_t e) {
SERIAL_ERROR((int)e); SERIAL_ERROR((int)e);
SERIAL_ERRORLNPGM(" - Invalid extruder number !"); SERIAL_ERRORLNPGM(" - Invalid extruder number !");
kill(); kill();
return 0.0;
} }
#ifdef HEATER_0_USES_MAX6675 #ifdef HEATER_0_USES_MAX6675
if (e == 0) if (e == 0)
@ -909,7 +910,7 @@ void disable_heater()
#endif #endif
#endif #endif
#if defined(TEMP_1_PIN) && TEMP_1_PIN > -1 #if defined(TEMP_1_PIN) && TEMP_1_PIN > -1 && EXTRUDERS > 1
target_temperature[1]=0; target_temperature[1]=0;
soft_pwm[1]=0; soft_pwm[1]=0;
#if defined(HEATER_1_PIN) && HEATER_1_PIN > -1 #if defined(HEATER_1_PIN) && HEATER_1_PIN > -1
@ -917,7 +918,7 @@ void disable_heater()
#endif #endif
#endif #endif
#if defined(TEMP_2_PIN) && TEMP_2_PIN > -1 #if defined(TEMP_2_PIN) && TEMP_2_PIN > -1 && EXTRUDERS > 2
target_temperature[2]=0; target_temperature[2]=0;
soft_pwm[2]=0; soft_pwm[2]=0;
#if defined(HEATER_2_PIN) && HEATER_2_PIN > -1 #if defined(HEATER_2_PIN) && HEATER_2_PIN > -1

View File

@ -305,7 +305,7 @@ static void lcd_implementation_init()
B00000 B00000
}; //thanks Sonny Mounicou }; //thanks Sonny Mounicou
#if defined(LCDI2C_TYPE_PCF8575) #if defined(LCD_I2C_TYPE_PCF8575)
lcd.begin(LCD_WIDTH, LCD_HEIGHT); lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#ifdef LCD_I2C_PIN_BL #ifdef LCD_I2C_PIN_BL
lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE); lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE);

View File

@ -1,6 +1,8 @@
========================== ==========================
Marlin 3D Printer Firmware Marlin 3D Printer Firmware
========================== ==========================
[![Coverity Scan Build Status](https://scan.coverity.com/projects/2224/badge.svg)](https://scan.coverity.com/projects/2224)
Marlin has a GPL license because I believe in open development. Marlin has a GPL license because I believe in open development.
Please do not use this code in products (3D printers, CNC etc) that are closed source or are crippled by a patent. Please do not use this code in products (3D printers, CNC etc) that are closed source or are crippled by a patent.
@ -193,6 +195,7 @@ M Codes
* M107 - Fan off * M107 - Fan off
* M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
* Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling * Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
* M112 - Emergency stop
* M114 - Output current position to serial port * M114 - Output current position to serial port
* M115 - Capabilities string * M115 - Capabilities string
* M117 - display message * M117 - display message