|
@@ -561,9 +561,9 @@ void servo_init() {
|
561
|
561
|
|
562
|
562
|
// Set position of Servo Endstops that are defined
|
563
|
563
|
#ifdef SERVO_ENDSTOPS
|
564
|
|
- for (int i = 0; i < 3; i++)
|
565
|
|
- if (servo_endstops[i] >= 0)
|
566
|
|
- servo[servo_endstops[i]].write(servo_endstop_angles[i * 2 + 1]);
|
|
564
|
+ for (int i = 0; i < 3; i++)
|
|
565
|
+ if (servo_endstops[i] >= 0)
|
|
566
|
+ servo[servo_endstops[i]].write(servo_endstop_angles[i * 2 + 1]);
|
567
|
567
|
#endif
|
568
|
568
|
|
569
|
569
|
#if SERVO_LEVELING
|
|
@@ -1317,21 +1317,21 @@ static void setup_for_endstop_move() {
|
1317
|
1317
|
|
1318
|
1318
|
st_synchronize();
|
1319
|
1319
|
|
1320
|
|
- #ifdef Z_PROBE_ENDSTOP
|
1321
|
|
- bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
|
1322
|
|
- if (z_probe_endstop)
|
1323
|
|
- #else
|
1324
|
|
- bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
1325
|
|
- if (z_min_endstop)
|
1326
|
|
- #endif
|
1327
|
|
- {
|
1328
|
|
- if (IsRunning()) {
|
1329
|
|
- SERIAL_ERROR_START;
|
1330
|
|
- SERIAL_ERRORLNPGM("Z-Probe failed to engage!");
|
1331
|
|
- LCD_ALERTMESSAGEPGM("Err: ZPROBE");
|
|
1320
|
+ #ifdef Z_PROBE_ENDSTOP
|
|
1321
|
+ bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
|
|
1322
|
+ if (z_probe_endstop)
|
|
1323
|
+ #else
|
|
1324
|
+ bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
|
1325
|
+ if (z_min_endstop)
|
|
1326
|
+ #endif
|
|
1327
|
+ {
|
|
1328
|
+ if (IsRunning()) {
|
|
1329
|
+ SERIAL_ERROR_START;
|
|
1330
|
+ SERIAL_ERRORLNPGM("Z-Probe failed to engage!");
|
|
1331
|
+ LCD_ALERTMESSAGEPGM("Err: ZPROBE");
|
|
1332
|
+ }
|
|
1333
|
+ Stop();
|
1332
|
1334
|
}
|
1333
|
|
- Stop();
|
1334
|
|
- }
|
1335
|
1335
|
|
1336
|
1336
|
#endif // Z_PROBE_ALLEN_KEY
|
1337
|
1337
|
|
|
@@ -1394,21 +1394,21 @@ static void setup_for_endstop_move() {
|
1394
|
1394
|
|
1395
|
1395
|
st_synchronize();
|
1396
|
1396
|
|
1397
|
|
- #ifdef Z_PROBE_ENDSTOP
|
1398
|
|
- bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
|
1399
|
|
- if (!z_probe_endstop)
|
1400
|
|
- #else
|
1401
|
|
- bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
1402
|
|
- if (!z_min_endstop)
|
1403
|
|
- #endif
|
1404
|
|
- {
|
1405
|
|
- if (IsRunning()) {
|
1406
|
|
- SERIAL_ERROR_START;
|
1407
|
|
- SERIAL_ERRORLNPGM("Z-Probe failed to retract!");
|
1408
|
|
- LCD_ALERTMESSAGEPGM("Err: ZPROBE");
|
|
1397
|
+ #ifdef Z_PROBE_ENDSTOP
|
|
1398
|
+ bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
|
|
1399
|
+ if (!z_probe_endstop)
|
|
1400
|
+ #else
|
|
1401
|
+ bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
|
1402
|
+ if (!z_min_endstop)
|
|
1403
|
+ #endif
|
|
1404
|
+ {
|
|
1405
|
+ if (IsRunning()) {
|
|
1406
|
+ SERIAL_ERROR_START;
|
|
1407
|
+ SERIAL_ERRORLNPGM("Z-Probe failed to retract!");
|
|
1408
|
+ LCD_ALERTMESSAGEPGM("Err: ZPROBE");
|
|
1409
|
+ }
|
|
1410
|
+ Stop();
|
1409
|
1411
|
}
|
1410
|
|
- Stop();
|
1411
|
|
- }
|
1412
|
1412
|
|
1413
|
1413
|
#endif
|
1414
|
1414
|
|
|
@@ -6093,82 +6093,83 @@ void prepare_move() {
|
6093
|
6093
|
#endif // HAS_CONTROLLERFAN
|
6094
|
6094
|
|
6095
|
6095
|
#ifdef SCARA
|
6096
|
|
-void calculate_SCARA_forward_Transform(float f_scara[3])
|
6097
|
|
-{
|
6098
|
|
- // Perform forward kinematics, and place results in delta[3]
|
6099
|
|
- // The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014
|
6100
|
|
-
|
6101
|
|
- float x_sin, x_cos, y_sin, y_cos;
|
6102
|
|
-
|
|
6096
|
+
|
|
6097
|
+ void calculate_SCARA_forward_Transform(float f_scara[3]) {
|
|
6098
|
+ // Perform forward kinematics, and place results in delta[3]
|
|
6099
|
+ // The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014
|
|
6100
|
+
|
|
6101
|
+ float x_sin, x_cos, y_sin, y_cos;
|
|
6102
|
+
|
6103
|
6103
|
//SERIAL_ECHOPGM("f_delta x="); SERIAL_ECHO(f_scara[X_AXIS]);
|
6104
|
6104
|
//SERIAL_ECHOPGM(" y="); SERIAL_ECHO(f_scara[Y_AXIS]);
|
6105
|
|
-
|
|
6105
|
+
|
6106
|
6106
|
x_sin = sin(f_scara[X_AXIS]/SCARA_RAD2DEG) * Linkage_1;
|
6107
|
6107
|
x_cos = cos(f_scara[X_AXIS]/SCARA_RAD2DEG) * Linkage_1;
|
6108
|
6108
|
y_sin = sin(f_scara[Y_AXIS]/SCARA_RAD2DEG) * Linkage_2;
|
6109
|
6109
|
y_cos = cos(f_scara[Y_AXIS]/SCARA_RAD2DEG) * Linkage_2;
|
6110
|
|
-
|
6111
|
|
- // SERIAL_ECHOPGM(" x_sin="); SERIAL_ECHO(x_sin);
|
6112
|
|
- // SERIAL_ECHOPGM(" x_cos="); SERIAL_ECHO(x_cos);
|
6113
|
|
- // SERIAL_ECHOPGM(" y_sin="); SERIAL_ECHO(y_sin);
|
6114
|
|
- // SERIAL_ECHOPGM(" y_cos="); SERIAL_ECHOLN(y_cos);
|
6115
|
|
-
|
|
6110
|
+
|
|
6111
|
+ //SERIAL_ECHOPGM(" x_sin="); SERIAL_ECHO(x_sin);
|
|
6112
|
+ //SERIAL_ECHOPGM(" x_cos="); SERIAL_ECHO(x_cos);
|
|
6113
|
+ //SERIAL_ECHOPGM(" y_sin="); SERIAL_ECHO(y_sin);
|
|
6114
|
+ //SERIAL_ECHOPGM(" y_cos="); SERIAL_ECHOLN(y_cos);
|
|
6115
|
+
|
6116
|
6116
|
delta[X_AXIS] = x_cos + y_cos + SCARA_offset_x; //theta
|
6117
|
6117
|
delta[Y_AXIS] = x_sin + y_sin + SCARA_offset_y; //theta+phi
|
6118
|
6118
|
|
6119
|
6119
|
//SERIAL_ECHOPGM(" delta[X_AXIS]="); SERIAL_ECHO(delta[X_AXIS]);
|
6120
|
6120
|
//SERIAL_ECHOPGM(" delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]);
|
6121
|
|
-}
|
|
6121
|
+ }
|
6122
|
6122
|
|
6123
|
|
-void calculate_delta(float cartesian[3]){
|
6124
|
|
- //reverse kinematics.
|
6125
|
|
- // Perform reversed kinematics, and place results in delta[3]
|
6126
|
|
- // The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014
|
6127
|
|
-
|
6128
|
|
- float SCARA_pos[2];
|
6129
|
|
- static float SCARA_C2, SCARA_S2, SCARA_K1, SCARA_K2, SCARA_theta, SCARA_psi;
|
6130
|
|
-
|
6131
|
|
- SCARA_pos[X_AXIS] = cartesian[X_AXIS] * axis_scaling[X_AXIS] - SCARA_offset_x; //Translate SCARA to standard X Y
|
6132
|
|
- SCARA_pos[Y_AXIS] = cartesian[Y_AXIS] * axis_scaling[Y_AXIS] - SCARA_offset_y; // With scaling factor.
|
6133
|
|
-
|
6134
|
|
- #if (Linkage_1 == Linkage_2)
|
6135
|
|
- SCARA_C2 = ( ( sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS]) ) / (2 * (float)L1_2) ) - 1;
|
6136
|
|
- #else
|
6137
|
|
- SCARA_C2 = ( sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS]) - (float)L1_2 - (float)L2_2 ) / 45000;
|
6138
|
|
- #endif
|
6139
|
|
-
|
6140
|
|
- SCARA_S2 = sqrt( 1 - sq(SCARA_C2) );
|
6141
|
|
-
|
6142
|
|
- SCARA_K1 = Linkage_1 + Linkage_2 * SCARA_C2;
|
6143
|
|
- SCARA_K2 = Linkage_2 * SCARA_S2;
|
6144
|
|
-
|
6145
|
|
- SCARA_theta = ( atan2(SCARA_pos[X_AXIS],SCARA_pos[Y_AXIS])-atan2(SCARA_K1, SCARA_K2) ) * -1;
|
6146
|
|
- SCARA_psi = atan2(SCARA_S2,SCARA_C2);
|
6147
|
|
-
|
6148
|
|
- delta[X_AXIS] = SCARA_theta * SCARA_RAD2DEG; // Multiply by 180/Pi - theta is support arm angle
|
6149
|
|
- delta[Y_AXIS] = (SCARA_theta + SCARA_psi) * SCARA_RAD2DEG; // - equal to sub arm angle (inverted motor)
|
6150
|
|
- delta[Z_AXIS] = cartesian[Z_AXIS];
|
6151
|
|
-
|
6152
|
|
- /*
|
6153
|
|
- SERIAL_ECHOPGM("cartesian x="); SERIAL_ECHO(cartesian[X_AXIS]);
|
6154
|
|
- SERIAL_ECHOPGM(" y="); SERIAL_ECHO(cartesian[Y_AXIS]);
|
6155
|
|
- SERIAL_ECHOPGM(" z="); SERIAL_ECHOLN(cartesian[Z_AXIS]);
|
6156
|
|
-
|
6157
|
|
- SERIAL_ECHOPGM("scara x="); SERIAL_ECHO(SCARA_pos[X_AXIS]);
|
6158
|
|
- SERIAL_ECHOPGM(" y="); SERIAL_ECHOLN(SCARA_pos[Y_AXIS]);
|
6159
|
|
-
|
6160
|
|
- SERIAL_ECHOPGM("delta x="); SERIAL_ECHO(delta[X_AXIS]);
|
6161
|
|
- SERIAL_ECHOPGM(" y="); SERIAL_ECHO(delta[Y_AXIS]);
|
6162
|
|
- SERIAL_ECHOPGM(" z="); SERIAL_ECHOLN(delta[Z_AXIS]);
|
6163
|
|
-
|
6164
|
|
- SERIAL_ECHOPGM("C2="); SERIAL_ECHO(SCARA_C2);
|
6165
|
|
- SERIAL_ECHOPGM(" S2="); SERIAL_ECHO(SCARA_S2);
|
6166
|
|
- SERIAL_ECHOPGM(" Theta="); SERIAL_ECHO(SCARA_theta);
|
6167
|
|
- SERIAL_ECHOPGM(" Psi="); SERIAL_ECHOLN(SCARA_psi);
|
6168
|
|
- SERIAL_ECHOLN(" ");*/
|
6169
|
|
-}
|
|
6123
|
+ void calculate_delta(float cartesian[3]){
|
|
6124
|
+ //reverse kinematics.
|
|
6125
|
+ // Perform reversed kinematics, and place results in delta[3]
|
|
6126
|
+ // The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014
|
|
6127
|
+
|
|
6128
|
+ float SCARA_pos[2];
|
|
6129
|
+ static float SCARA_C2, SCARA_S2, SCARA_K1, SCARA_K2, SCARA_theta, SCARA_psi;
|
|
6130
|
+
|
|
6131
|
+ SCARA_pos[X_AXIS] = cartesian[X_AXIS] * axis_scaling[X_AXIS] - SCARA_offset_x; //Translate SCARA to standard X Y
|
|
6132
|
+ SCARA_pos[Y_AXIS] = cartesian[Y_AXIS] * axis_scaling[Y_AXIS] - SCARA_offset_y; // With scaling factor.
|
|
6133
|
+
|
|
6134
|
+ #if (Linkage_1 == Linkage_2)
|
|
6135
|
+ SCARA_C2 = ( ( sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS]) ) / (2 * (float)L1_2) ) - 1;
|
|
6136
|
+ #else
|
|
6137
|
+ SCARA_C2 = ( sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS]) - (float)L1_2 - (float)L2_2 ) / 45000;
|
|
6138
|
+ #endif
|
|
6139
|
+
|
|
6140
|
+ SCARA_S2 = sqrt( 1 - sq(SCARA_C2) );
|
|
6141
|
+
|
|
6142
|
+ SCARA_K1 = Linkage_1 + Linkage_2 * SCARA_C2;
|
|
6143
|
+ SCARA_K2 = Linkage_2 * SCARA_S2;
|
|
6144
|
+
|
|
6145
|
+ SCARA_theta = ( atan2(SCARA_pos[X_AXIS],SCARA_pos[Y_AXIS])-atan2(SCARA_K1, SCARA_K2) ) * -1;
|
|
6146
|
+ SCARA_psi = atan2(SCARA_S2,SCARA_C2);
|
|
6147
|
+
|
|
6148
|
+ delta[X_AXIS] = SCARA_theta * SCARA_RAD2DEG; // Multiply by 180/Pi - theta is support arm angle
|
|
6149
|
+ delta[Y_AXIS] = (SCARA_theta + SCARA_psi) * SCARA_RAD2DEG; // - equal to sub arm angle (inverted motor)
|
|
6150
|
+ delta[Z_AXIS] = cartesian[Z_AXIS];
|
|
6151
|
+
|
|
6152
|
+ /*
|
|
6153
|
+ SERIAL_ECHOPGM("cartesian x="); SERIAL_ECHO(cartesian[X_AXIS]);
|
|
6154
|
+ SERIAL_ECHOPGM(" y="); SERIAL_ECHO(cartesian[Y_AXIS]);
|
|
6155
|
+ SERIAL_ECHOPGM(" z="); SERIAL_ECHOLN(cartesian[Z_AXIS]);
|
|
6156
|
+
|
|
6157
|
+ SERIAL_ECHOPGM("scara x="); SERIAL_ECHO(SCARA_pos[X_AXIS]);
|
|
6158
|
+ SERIAL_ECHOPGM(" y="); SERIAL_ECHOLN(SCARA_pos[Y_AXIS]);
|
|
6159
|
+
|
|
6160
|
+ SERIAL_ECHOPGM("delta x="); SERIAL_ECHO(delta[X_AXIS]);
|
|
6161
|
+ SERIAL_ECHOPGM(" y="); SERIAL_ECHO(delta[Y_AXIS]);
|
|
6162
|
+ SERIAL_ECHOPGM(" z="); SERIAL_ECHOLN(delta[Z_AXIS]);
|
|
6163
|
+
|
|
6164
|
+ SERIAL_ECHOPGM("C2="); SERIAL_ECHO(SCARA_C2);
|
|
6165
|
+ SERIAL_ECHOPGM(" S2="); SERIAL_ECHO(SCARA_S2);
|
|
6166
|
+ SERIAL_ECHOPGM(" Theta="); SERIAL_ECHO(SCARA_theta);
|
|
6167
|
+ SERIAL_ECHOPGM(" Psi="); SERIAL_ECHOLN(SCARA_psi);
|
|
6168
|
+ SERIAL_EOL;
|
|
6169
|
+ */
|
|
6170
|
+ }
|
6170
|
6171
|
|
6171
|
|
-#endif
|
|
6172
|
+#endif // SCARA
|
6172
|
6173
|
|
6173
|
6174
|
#ifdef TEMP_STAT_LEDS
|
6174
|
6175
|
|
|
@@ -6399,88 +6400,89 @@ void kill()
|
6399
|
6400
|
st_synchronize();
|
6400
|
6401
|
}
|
6401
|
6402
|
}
|
6402
|
|
-#endif
|
6403
|
6403
|
|
6404
|
|
-void Stop() {
|
6405
|
|
- disable_all_heaters();
|
6406
|
|
- if (IsRunning()) {
|
6407
|
|
- Running = false;
|
6408
|
|
- Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart
|
6409
|
|
- SERIAL_ERROR_START;
|
6410
|
|
- SERIAL_ERRORLNPGM(MSG_ERR_STOPPED);
|
6411
|
|
- LCD_MESSAGEPGM(MSG_STOPPED);
|
6412
|
|
- }
|
6413
|
|
-}
|
|
6404
|
+#endif // FILAMENT_RUNOUT_SENSOR
|
6414
|
6405
|
|
6415
|
6406
|
#ifdef FAST_PWM_FAN
|
6416
|
|
-void setPwmFrequency(uint8_t pin, int val)
|
6417
|
|
-{
|
6418
|
|
- val &= 0x07;
|
6419
|
|
- switch(digitalPinToTimer(pin))
|
6420
|
|
- {
|
6421
|
6407
|
|
6422
|
|
- #if defined(TCCR0A)
|
6423
|
|
- case TIMER0A:
|
6424
|
|
- case TIMER0B:
|
6425
|
|
-// TCCR0B &= ~(_BV(CS00) | _BV(CS01) | _BV(CS02));
|
6426
|
|
-// TCCR0B |= val;
|
6427
|
|
- break;
|
6428
|
|
- #endif
|
|
6408
|
+ void setPwmFrequency(uint8_t pin, int val) {
|
|
6409
|
+ val &= 0x07;
|
|
6410
|
+ switch (digitalPinToTimer(pin)) {
|
6429
|
6411
|
|
6430
|
|
- #if defined(TCCR1A)
|
6431
|
|
- case TIMER1A:
|
6432
|
|
- case TIMER1B:
|
6433
|
|
-// TCCR1B &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));
|
6434
|
|
-// TCCR1B |= val;
|
6435
|
|
- break;
|
6436
|
|
- #endif
|
|
6412
|
+ #if defined(TCCR0A)
|
|
6413
|
+ case TIMER0A:
|
|
6414
|
+ case TIMER0B:
|
|
6415
|
+ // TCCR0B &= ~(_BV(CS00) | _BV(CS01) | _BV(CS02));
|
|
6416
|
+ // TCCR0B |= val;
|
|
6417
|
+ break;
|
|
6418
|
+ #endif
|
6437
|
6419
|
|
6438
|
|
- #if defined(TCCR2)
|
6439
|
|
- case TIMER2:
|
6440
|
|
- case TIMER2:
|
6441
|
|
- TCCR2 &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));
|
6442
|
|
- TCCR2 |= val;
|
6443
|
|
- break;
|
6444
|
|
- #endif
|
|
6420
|
+ #if defined(TCCR1A)
|
|
6421
|
+ case TIMER1A:
|
|
6422
|
+ case TIMER1B:
|
|
6423
|
+ // TCCR1B &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));
|
|
6424
|
+ // TCCR1B |= val;
|
|
6425
|
+ break;
|
|
6426
|
+ #endif
|
6445
|
6427
|
|
6446
|
|
- #if defined(TCCR2A)
|
6447
|
|
- case TIMER2A:
|
6448
|
|
- case TIMER2B:
|
6449
|
|
- TCCR2B &= ~(_BV(CS20) | _BV(CS21) | _BV(CS22));
|
6450
|
|
- TCCR2B |= val;
|
6451
|
|
- break;
|
6452
|
|
- #endif
|
|
6428
|
+ #if defined(TCCR2)
|
|
6429
|
+ case TIMER2:
|
|
6430
|
+ case TIMER2:
|
|
6431
|
+ TCCR2 &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));
|
|
6432
|
+ TCCR2 |= val;
|
|
6433
|
+ break;
|
|
6434
|
+ #endif
|
6453
|
6435
|
|
6454
|
|
- #if defined(TCCR3A)
|
6455
|
|
- case TIMER3A:
|
6456
|
|
- case TIMER3B:
|
6457
|
|
- case TIMER3C:
|
6458
|
|
- TCCR3B &= ~(_BV(CS30) | _BV(CS31) | _BV(CS32));
|
6459
|
|
- TCCR3B |= val;
|
6460
|
|
- break;
|
6461
|
|
- #endif
|
|
6436
|
+ #if defined(TCCR2A)
|
|
6437
|
+ case TIMER2A:
|
|
6438
|
+ case TIMER2B:
|
|
6439
|
+ TCCR2B &= ~(_BV(CS20) | _BV(CS21) | _BV(CS22));
|
|
6440
|
+ TCCR2B |= val;
|
|
6441
|
+ break;
|
|
6442
|
+ #endif
|
|
6443
|
+
|
|
6444
|
+ #if defined(TCCR3A)
|
|
6445
|
+ case TIMER3A:
|
|
6446
|
+ case TIMER3B:
|
|
6447
|
+ case TIMER3C:
|
|
6448
|
+ TCCR3B &= ~(_BV(CS30) | _BV(CS31) | _BV(CS32));
|
|
6449
|
+ TCCR3B |= val;
|
|
6450
|
+ break;
|
|
6451
|
+ #endif
|
|
6452
|
+
|
|
6453
|
+ #if defined(TCCR4A)
|
|
6454
|
+ case TIMER4A:
|
|
6455
|
+ case TIMER4B:
|
|
6456
|
+ case TIMER4C:
|
|
6457
|
+ TCCR4B &= ~(_BV(CS40) | _BV(CS41) | _BV(CS42));
|
|
6458
|
+ TCCR4B |= val;
|
|
6459
|
+ break;
|
|
6460
|
+ #endif
|
6462
|
6461
|
|
6463
|
|
- #if defined(TCCR4A)
|
6464
|
|
- case TIMER4A:
|
6465
|
|
- case TIMER4B:
|
6466
|
|
- case TIMER4C:
|
6467
|
|
- TCCR4B &= ~(_BV(CS40) | _BV(CS41) | _BV(CS42));
|
6468
|
|
- TCCR4B |= val;
|
6469
|
|
- break;
|
6470
|
|
- #endif
|
6471
|
|
-
|
6472
|
|
- #if defined(TCCR5A)
|
6473
|
|
- case TIMER5A:
|
6474
|
|
- case TIMER5B:
|
6475
|
|
- case TIMER5C:
|
6476
|
|
- TCCR5B &= ~(_BV(CS50) | _BV(CS51) | _BV(CS52));
|
6477
|
|
- TCCR5B |= val;
|
6478
|
|
- break;
|
6479
|
|
- #endif
|
|
6462
|
+ #if defined(TCCR5A)
|
|
6463
|
+ case TIMER5A:
|
|
6464
|
+ case TIMER5B:
|
|
6465
|
+ case TIMER5C:
|
|
6466
|
+ TCCR5B &= ~(_BV(CS50) | _BV(CS51) | _BV(CS52));
|
|
6467
|
+ TCCR5B |= val;
|
|
6468
|
+ break;
|
|
6469
|
+ #endif
|
|
6470
|
+
|
|
6471
|
+ }
|
|
6472
|
+ }
|
6480
|
6473
|
|
|
6474
|
+#endif // FAST_PWM_FAN
|
|
6475
|
+
|
|
6476
|
+void Stop() {
|
|
6477
|
+ disable_all_heaters();
|
|
6478
|
+ if (IsRunning()) {
|
|
6479
|
+ Running = false;
|
|
6480
|
+ Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart
|
|
6481
|
+ SERIAL_ERROR_START;
|
|
6482
|
+ SERIAL_ERRORLNPGM(MSG_ERR_STOPPED);
|
|
6483
|
+ LCD_MESSAGEPGM(MSG_STOPPED);
|
6481
|
6484
|
}
|
6482
|
6485
|
}
|
6483
|
|
-#endif //FAST_PWM_FAN
|
6484
|
6486
|
|
6485
|
6487
|
bool setTargetedHotend(int code){
|
6486
|
6488
|
target_extruder = active_extruder;
|