Merge remote-tracking branch 'upstream/MK3' into flashair_display_ip

This commit is contained in:
odaki 2020-11-23 15:53:03 +09:00
commit 61c48df0bd
1 changed files with 7 additions and 5 deletions

View File

@ -495,20 +495,22 @@ int8_t xyzcal_find_point_center2(uint16_t delay_us)
xyzcal_lineXYZ_to(_X, _Y, z0 - 400, 500, 1); xyzcal_lineXYZ_to(_X, _Y, z0 - 400, 500, 1);
if (has_temperature_compensation()){ if (has_temperature_compensation()){
z0 = _Z - 20; // normal PINDA z0 = _Z - 20; // normal PINDA
return xyzcal_find_point_center2A(x0, y0, z0, delay_us); return xyzcal_find_point_center2A(x0, y0, z0, delay_us);
} else { } else {
// try searching harder, each PINDA is different // try searching harder, each PINDA is different
int8_t rv = 0;
for(z0 = _Z - 20; z0 <= _Z + 140; z0 += 20 ){ // alternate PINDA for(z0 = _Z - 20; z0 <= _Z + 140; z0 += 20 ){ // alternate PINDA
int8_t rv = xyzcal_find_point_center2A(x0, y0, z0, delay_us); rv = xyzcal_find_point_center2A(x0, y0, z0, delay_us);
printf_P(PSTR(" z0=%d"), z0); printf_P(PSTR(" z0=%d"), z0);
if( rv != 0 ){ if( rv != 0 ){
printf_P(PSTR("ok\n")); puts_P(PSTR("ok"));
return rv; break;
} else { } else {
printf_P(PSTR("fail\n")); puts_P(PSTR("fail"));
} }
} }
return rv;
} }
} }