Adjust spacing in Marlin_main.cpp and stepper.*

This commit is contained in:
Scott Lahteine 2015-05-17 01:47:02 -07:00
parent 072625ccad
commit c54a2ea042
3 changed files with 172 additions and 171 deletions

View File

@ -6093,8 +6093,8 @@ void prepare_move() {
#endif // HAS_CONTROLLERFAN #endif // HAS_CONTROLLERFAN
#ifdef SCARA #ifdef SCARA
void calculate_SCARA_forward_Transform(float f_scara[3])
{ void calculate_SCARA_forward_Transform(float f_scara[3]) {
// Perform forward kinematics, and place results in delta[3] // Perform forward kinematics, and place results in delta[3]
// The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014 // The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014
@ -6108,19 +6108,19 @@ void calculate_SCARA_forward_Transform(float f_scara[3])
y_sin = sin(f_scara[Y_AXIS]/SCARA_RAD2DEG) * Linkage_2; y_sin = sin(f_scara[Y_AXIS]/SCARA_RAD2DEG) * Linkage_2;
y_cos = cos(f_scara[Y_AXIS]/SCARA_RAD2DEG) * Linkage_2; y_cos = cos(f_scara[Y_AXIS]/SCARA_RAD2DEG) * Linkage_2;
// SERIAL_ECHOPGM(" x_sin="); SERIAL_ECHO(x_sin); //SERIAL_ECHOPGM(" x_sin="); SERIAL_ECHO(x_sin);
// SERIAL_ECHOPGM(" x_cos="); SERIAL_ECHO(x_cos); //SERIAL_ECHOPGM(" x_cos="); SERIAL_ECHO(x_cos);
// SERIAL_ECHOPGM(" y_sin="); SERIAL_ECHO(y_sin); //SERIAL_ECHOPGM(" y_sin="); SERIAL_ECHO(y_sin);
// SERIAL_ECHOPGM(" y_cos="); SERIAL_ECHOLN(y_cos); //SERIAL_ECHOPGM(" y_cos="); SERIAL_ECHOLN(y_cos);
delta[X_AXIS] = x_cos + y_cos + SCARA_offset_x; //theta delta[X_AXIS] = x_cos + y_cos + SCARA_offset_x; //theta
delta[Y_AXIS] = x_sin + y_sin + SCARA_offset_y; //theta+phi delta[Y_AXIS] = x_sin + y_sin + SCARA_offset_y; //theta+phi
//SERIAL_ECHOPGM(" delta[X_AXIS]="); SERIAL_ECHO(delta[X_AXIS]); //SERIAL_ECHOPGM(" delta[X_AXIS]="); SERIAL_ECHO(delta[X_AXIS]);
//SERIAL_ECHOPGM(" delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); //SERIAL_ECHOPGM(" delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]);
} }
void calculate_delta(float cartesian[3]){ void calculate_delta(float cartesian[3]){
//reverse kinematics. //reverse kinematics.
// Perform reversed kinematics, and place results in delta[3] // Perform reversed kinematics, and place results in delta[3]
// The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014 // The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014
@ -6165,10 +6165,11 @@ void calculate_delta(float cartesian[3]){
SERIAL_ECHOPGM(" S2="); SERIAL_ECHO(SCARA_S2); SERIAL_ECHOPGM(" S2="); SERIAL_ECHO(SCARA_S2);
SERIAL_ECHOPGM(" Theta="); SERIAL_ECHO(SCARA_theta); SERIAL_ECHOPGM(" Theta="); SERIAL_ECHO(SCARA_theta);
SERIAL_ECHOPGM(" Psi="); SERIAL_ECHOLN(SCARA_psi); SERIAL_ECHOPGM(" Psi="); SERIAL_ECHOLN(SCARA_psi);
SERIAL_ECHOLN(" ");*/ SERIAL_EOL;
} */
}
#endif #endif // SCARA
#ifdef TEMP_STAT_LEDS #ifdef TEMP_STAT_LEDS
@ -6399,39 +6400,28 @@ void kill()
st_synchronize(); st_synchronize();
} }
} }
#endif
void Stop() { #endif // FILAMENT_RUNOUT_SENSOR
disable_all_heaters();
if (IsRunning()) {
Running = false;
Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_STOPPED);
LCD_MESSAGEPGM(MSG_STOPPED);
}
}
#ifdef FAST_PWM_FAN #ifdef FAST_PWM_FAN
void setPwmFrequency(uint8_t pin, int val)
{ void setPwmFrequency(uint8_t pin, int val) {
val &= 0x07; val &= 0x07;
switch(digitalPinToTimer(pin)) switch (digitalPinToTimer(pin)) {
{
#if defined(TCCR0A) #if defined(TCCR0A)
case TIMER0A: case TIMER0A:
case TIMER0B: case TIMER0B:
// TCCR0B &= ~(_BV(CS00) | _BV(CS01) | _BV(CS02)); // TCCR0B &= ~(_BV(CS00) | _BV(CS01) | _BV(CS02));
// TCCR0B |= val; // TCCR0B |= val;
break; break;
#endif #endif
#if defined(TCCR1A) #if defined(TCCR1A)
case TIMER1A: case TIMER1A:
case TIMER1B: case TIMER1B:
// TCCR1B &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12)); // TCCR1B &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));
// TCCR1B |= val; // TCCR1B |= val;
break; break;
#endif #endif
@ -6479,8 +6469,20 @@ void setPwmFrequency(uint8_t pin, int val)
#endif #endif
} }
}
#endif // FAST_PWM_FAN
void Stop() {
disable_all_heaters();
if (IsRunning()) {
Running = false;
Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_STOPPED);
LCD_MESSAGEPGM(MSG_STOPPED);
}
} }
#endif //FAST_PWM_FAN
bool setTargetedHotend(int code){ bool setTargetedHotend(int code){
target_extruder = active_extruder; target_extruder = active_extruder;

View File

@ -1110,9 +1110,8 @@ long st_get_position(uint8_t axis) {
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_LEVELING
float st_get_position_mm(uint8_t axis) { float st_get_position_mm(AxisEnum axis) {
float steper_position_in_steps = st_get_position(axis); return st_get_position(axis) / axis_steps_per_unit[axis];
return steper_position_in_steps / axis_steps_per_unit[axis];
} }
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_LEVELING

View File

@ -67,9 +67,9 @@ void st_set_e_position(const long &e);
long st_get_position(uint8_t axis); long st_get_position(uint8_t axis);
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_LEVELING
// Get current position in mm // Get current position in mm
float st_get_position_mm(uint8_t axis); float st_get_position_mm(AxisEnum axis);
#endif //ENABLE_AUTO_BED_LEVELING #endif
// The stepper subsystem goes to sleep when it runs out of things to execute. Call this // The stepper subsystem goes to sleep when it runs out of things to execute. Call this
// to notify the subsystem that it is time to go to work. // to notify the subsystem that it is time to go to work.