@@ -699,31 +699,29 @@ uint8_t xyzcal_find_pattern_12x12_in_32x32(uint8_t* pixels, uint16_t* pattern, u
699
699
const uint16_t xyzcal_point_pattern_10[12 ] PROGMEM = {0x000 , 0x0f0 , 0x1f8 , 0x3fc , 0x7fe , 0x7fe , 0x7fe , 0x7fe , 0x3fc , 0x1f8 , 0x0f0 , 0x000 };
700
700
const uint16_t xyzcal_point_pattern_08[12 ] PROGMEM = {0x000 , 0x000 , 0x0f0 , 0x1f8 , 0x3fc , 0x3fc , 0x3fc , 0x3fc , 0x1f8 , 0x0f0 , 0x000 , 0x000 };
701
701
702
- bool xyzcal_searchZ (void )
703
- {
704
- // @size=118
702
+ bool xyzcal_searchZ (void ) {
703
+ // @size=118
705
704
DBG (_n (" xyzcal_searchZ x=%ld y=%ld z=%ld\n " ), count_position[X_AXIS], count_position[Y_AXIS], count_position[Z_AXIS]);
706
705
int16_t x0 = _X;
707
706
int16_t y0 = _Y;
708
- int16_t z0 = _Z;
707
+ int16_t z = _Z;
709
708
// int16_t min_z = -6000;
710
709
// int16_t dz = 100;
711
- int16_t z = z0;
712
- while (z > -2300 ) // -6mm + 0.25mm
713
- {
710
+ while (z > -2300 ) { // -6mm + 0.25mm
714
711
uint16_t ad = 0 ;
715
- if (xyzcal_spiral8 (x0, y0 , z, 100 , 900 , 320 , 1 , &ad)) // dz=100 radius=900 delay=400
716
- {
717
- int16_t x_on = _X;
718
- int16_t y_on = _Y;
719
- int16_t z_on = _Z;
712
+ if (xyzcal_spiral8 (x0, y0 , z, 100 , 900 , 320 , 1 , &ad)) { // dz=100 radius=900 delay=400
720
713
// @size=82
721
- DBG (_n (" ON-SIGNAL at x=%d y=%d z=%d ad=%d\n " ), x_on, y_on, z_on, ad);
714
+ DBG (_n (" ON-SIGNAL at x=%d y=%d z=%d ad=%d\n " ), _X, _Y, _Z, ad);
715
+
716
+ // / return to starting XY position
717
+ // / magic constant, lowers min_z after searchZ to obtain more dense data in scan
718
+ const pos_i16_t lower_z = 72 ;
719
+ xyzcal_lineXYZ_to (x0, y0 , _Z - lower_z, 200 , 0 );
722
720
return true ;
723
721
}
724
722
z -= 400 ;
725
723
}
726
- // @size=138
724
+ // @size=138
727
725
DBG (_n (" xyzcal_searchZ no signal\n x=%ld y=%ld z=%ld\n " ), count_position[X_AXIS], count_position[Y_AXIS], count_position[Z_AXIS]);
728
726
return false ;
729
727
}
@@ -972,14 +970,10 @@ bool xyzcal_find_bed_induction_sensor_point_xy(void){
972
970
// @size=258
973
971
DBG (_n (" xyzcal_find_bed_induction_sensor_point_xy x=%ld y=%ld z=%ld\n " ), count_position[X_AXIS], count_position[Y_AXIS], count_position[Z_AXIS]);
974
972
st_synchronize ();
975
- // /< magic constant, lowers min_z after searchZ to obtain more dense data in scan
976
- const pos_i16_t lower_z = 72 ;
977
973
978
974
xyzcal_meassure_enter ();
979
- if (xyzcal_searchZ ()){
980
- xyzcal_lineXYZ_to (_X, _Y, _Z - lower_z, 200 , 0 );
975
+ if (xyzcal_searchZ ())
981
976
ret = xyzcal_scan_and_process ();
982
- }
983
977
xyzcal_meassure_leave ();
984
978
return ret;
985
979
}
0 commit comments