Merged updates from Marlin_v1.

This commit is contained in:
Johann Rocholl
2012-12-16 12:19:24 -08:00
84 changed files with 2037 additions and 3806 deletions

View File

@@ -147,7 +147,6 @@ CardReader card;
float homing_feedrate[] = HOMING_FEEDRATE;
bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
int feedmultiply=100; //100->1 200->2
bool feedmultiplychanged;
int saved_feedmultiply;
int extrudemultiply=100; //100->1 200->2
float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
@@ -826,7 +825,7 @@ void process_commands()
{
switch( (int)code_value() )
{
#ifdef ULTRA_LCD
#ifdef ULTIPANEL
case 0: // M0 - Unconditional stop - Wait for user button press on LCD
case 1: // M1 - Conditional stop - Wait for user button press on LCD
{
@@ -947,25 +946,23 @@ void process_commands()
if (code_seen('S'))
{
int pin_status = code_value();
int pin_number = LED_PIN;
if (code_seen('P') && pin_status >= 0 && pin_status <= 255)
pin_number = code_value();
for(int8_t i = 0; i < (int8_t)sizeof(sensitive_pins); i++)
{
int pin_number = code_value();
for(int8_t i = 0; i < (int8_t)sizeof(sensitive_pins); i++)
if (sensitive_pins[i] == pin_number)
{
if (sensitive_pins[i] == pin_number)
{
pin_number = -1;
break;
}
}
if (pin_number > -1)
{
pinMode(pin_number, OUTPUT);
digitalWrite(pin_number, pin_status);
analogWrite(pin_number, pin_status);
pin_number = -1;
break;
}
}
if (pin_number > -1)
{
pinMode(pin_number, OUTPUT);
digitalWrite(pin_number, pin_status);
analogWrite(pin_number, pin_status);
}
}
break;
case 104: // M104
@@ -1211,7 +1208,10 @@ void process_commands()
SERIAL_PROTOCOLPGM(MSG_M115_REPORT);
break;
case 117: // M117 display message
lcd_setstatus(cmdbuffer[bufindr]+5);
starpos = (strchr(strchr_pointer + 5,'*'));
if(starpos!=NULL)
*(starpos-1)='\0';
lcd_setstatus(strchr_pointer + 5);
break;
case 114: // M114
SERIAL_PROTOCOLPGM("X:");
@@ -1362,7 +1362,6 @@ void process_commands()
if(code_seen('S'))
{
feedmultiply = code_value() ;
feedmultiplychanged = true;
}
}
break;
@@ -1465,27 +1464,27 @@ void process_commands()
st_synchronize();
}
break;
case 500: // Store settings in EEPROM
case 500: // M500 Store settings in EEPROM
{
Config_StoreSettings();
}
break;
case 501: // Read settings from EEPROM
case 501: // M501 Read settings from EEPROM
{
Config_RetrieveSettings();
}
break;
case 502: // Revert to default settings
case 502: // M502 Revert to default settings
{
Config_ResetDefault();
}
break;
case 503: // print settings currently in memory
case 503: // M503 print settings currently in memory
{
Config_PrintSettings();
}
break;
case 907: // Set digital trimpot motor current using axis codes.
case 907: // M907 Set digital trimpot motor current using axis codes.
{
#if DIGIPOTSS_PIN > -1
for(int i=0;i<=NUM_AXIS;i++) if(code_seen(axis_codes[i])) digipot_current(i,code_value());
@@ -1493,7 +1492,7 @@ void process_commands()
if(code_seen('S')) for(int i=0;i<=4;i++) digipot_current(i,code_value());
#endif
}
case 908: // Control digital trimpot directly.
case 908: // M908 Control digital trimpot directly.
{
#if DIGIPOTSS_PIN > -1
uint8_t channel,current;
@@ -1503,7 +1502,7 @@ void process_commands()
#endif
}
break;
case 350: // Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
case 350: // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
{
#if X_MS1_PIN > -1
if(code_seen('S')) for(int i=0;i<=4;i++) microstep_mode(i,code_value());
@@ -1513,7 +1512,7 @@ void process_commands()
#endif
}
break;
case 351: // Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low.
case 351: // M351 Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low.
{
#if X_MS1_PIN > -1
if(code_seen('S')) switch((int)code_value())
@@ -1531,8 +1530,9 @@ void process_commands()
#endif
}
break;
case 999: // Restart after being stopped
case 999: // M999: Restart after being stopped
Stopped = false;
lcd_reset_alert_level();
gcode_LastN = Stopped_gcode_LastN;
FlushSerialRequestResend();
break;
@@ -1880,7 +1880,7 @@ void setPwmFrequency(uint8_t pin, int val)
#if defined(TCCR0A)
case TIMER0A:
case TIMER0B:
// TCCR0B &= ~(CS00 | CS01 | CS02);
// TCCR0B &= ~(_BV(CS00) | _BV(CS01) | _BV(CS02));
// TCCR0B |= val;
break;
#endif
@@ -1888,7 +1888,7 @@ void setPwmFrequency(uint8_t pin, int val)
#if defined(TCCR1A)
case TIMER1A:
case TIMER1B:
// TCCR1B &= ~(CS10 | CS11 | CS12);
// TCCR1B &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));
// TCCR1B |= val;
break;
#endif
@@ -1896,7 +1896,7 @@ void setPwmFrequency(uint8_t pin, int val)
#if defined(TCCR2)
case TIMER2:
case TIMER2:
TCCR2 &= ~(CS10 | CS11 | CS12);
TCCR2 &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));
TCCR2 |= val;
break;
#endif
@@ -1904,7 +1904,7 @@ void setPwmFrequency(uint8_t pin, int val)
#if defined(TCCR2A)
case TIMER2A:
case TIMER2B:
TCCR2B &= ~(CS20 | CS21 | CS22);
TCCR2B &= ~(_BV(CS20) | _BV(CS21) | _BV(CS22));
TCCR2B |= val;
break;
#endif
@@ -1913,7 +1913,7 @@ void setPwmFrequency(uint8_t pin, int val)
case TIMER3A:
case TIMER3B:
case TIMER3C:
TCCR3B &= ~(CS30 | CS31 | CS32);
TCCR3B &= ~(_BV(CS30) | _BV(CS31) | _BV(CS32));
TCCR3B |= val;
break;
#endif
@@ -1922,7 +1922,7 @@ void setPwmFrequency(uint8_t pin, int val)
case TIMER4A:
case TIMER4B:
case TIMER4C:
TCCR4B &= ~(CS40 | CS41 | CS42);
TCCR4B &= ~(_BV(CS40) | _BV(CS41) | _BV(CS42));
TCCR4B |= val;
break;
#endif
@@ -1931,7 +1931,7 @@ void setPwmFrequency(uint8_t pin, int val)
case TIMER5A:
case TIMER5B:
case TIMER5C:
TCCR5B &= ~(CS50 | CS51 | CS52);
TCCR5B &= ~(_BV(CS50) | _BV(CS51) | _BV(CS52));
TCCR5B |= val;
break;
#endif