|
@@ -138,15 +138,18 @@ pos_mm_t pos_2_mm(float pos){
|
|
|
void xyzcal_meassure_enter(void)
|
|
|
{
|
|
|
DBG(_n("xyzcal_meassure_enter\n"));
|
|
|
+
|
|
|
+
|
|
|
disable_heater();
|
|
|
- DISABLE_SOFT_PWM_INTERRUPT();
|
|
|
-#if (defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1))
|
|
|
- DISABLE_FANCHECK_INTERRUPT();
|
|
|
-#endif
|
|
|
+ st_synchronize();
|
|
|
+
|
|
|
+
|
|
|
DISABLE_STEPPER_DRIVER_INTERRUPT();
|
|
|
#ifdef WATCHDOG
|
|
|
wdt_disable();
|
|
|
#endif
|
|
|
+
|
|
|
+
|
|
|
sm4_stop_cb = 0;
|
|
|
sm4_update_pos_cb = xyzcal_update_pos;
|
|
|
sm4_calc_delay_cb = xyzcal_calc_delay;
|
|
@@ -156,20 +159,15 @@ void xyzcal_meassure_leave(void)
|
|
|
{
|
|
|
DBG(_n("xyzcal_meassure_leave\n"));
|
|
|
planner_abort_hard();
|
|
|
- ENABLE_SOFT_PWM_INTERRUPT();
|
|
|
-#if (defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1))
|
|
|
- ENABLE_FANCHECK_INTERRUPT();
|
|
|
-#endif
|
|
|
- ENABLE_STEPPER_DRIVER_INTERRUPT();
|
|
|
+
|
|
|
+
|
|
|
#ifdef WATCHDOG
|
|
|
wdt_enable(WDTO_4S);
|
|
|
#ifdef EMERGENCY_HANDLERS
|
|
|
WDTCSR |= (1 << WDIE);
|
|
|
#endif
|
|
|
#endif
|
|
|
- sm4_stop_cb = 0;
|
|
|
- sm4_update_pos_cb = 0;
|
|
|
- sm4_calc_delay_cb = 0;
|
|
|
+ ENABLE_STEPPER_DRIVER_INTERRUPT();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -999,13 +997,9 @@ BedSkewOffsetDetectionResultType xyzcal_scan_and_process(){
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-BedSkewOffsetDetectionResultType xyzcal_find_bed_induction_sensor_point_xy(void){
|
|
|
- BedSkewOffsetDetectionResultType ret = BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND;
|
|
|
-
|
|
|
-
|
|
|
+BedSkewOffsetDetectionResultType xyzcal_find_bed_induction_sensor_point_xy(void) {
|
|
|
|
|
|
- st_synchronize();
|
|
|
-
|
|
|
+ BedSkewOffsetDetectionResultType ret = BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND;
|
|
|
xyzcal_meassure_enter();
|
|
|
if (xyzcal_searchZ())
|
|
|
ret = xyzcal_scan_and_process();
|