Reduce unnecessary code

This commit is contained in:
espr14 2021-01-13 13:59:20 +01:00
parent 2981b9e9c5
commit 9867ecd3f9

View File

@ -689,25 +689,6 @@ uint8_t xyzcal_find_pattern_12x12_in_32x32(uint8_t* pixels, uint16_t* pattern, u
return max_match;
}
uint8_t xyzcal_xycoords2point(int16_t x, int16_t y)
{
uint8_t ix = (x > 10000)?1:0;
uint8_t iy = (y > 10000)?1:0;
return iy?(3-ix):ix;
}
//MK3
#if ((MOTHERBOARD == BOARD_EINSY_1_0a))
const int16_t xyzcal_point_xcoords[4] PROGMEM = {1200, 22000, 22000, 1200};
const int16_t xyzcal_point_ycoords[4] PROGMEM = {600, 600, 19800, 19800};
#endif //((MOTHERBOARD == BOARD_EINSY_1_0a))
//MK2.5
#if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
const int16_t xyzcal_point_xcoords[4] PROGMEM = {1200, 22000, 22000, 1200};
const int16_t xyzcal_point_ycoords[4] PROGMEM = {700, 700, 19800, 19800};
#endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
const uint16_t xyzcal_point_pattern_10[12] PROGMEM = {0x000, 0x0f0, 0x1f8, 0x3fc, 0x7fe, 0x7fe, 0x7fe, 0x7fe, 0x3fc, 0x1f8, 0x0f0, 0x000};
const uint16_t xyzcal_point_pattern_08[12] PROGMEM = {0x000, 0x000, 0x0f0, 0x1f8, 0x3fc, 0x3fc, 0x3fc, 0x3fc, 0x1f8, 0x0f0, 0x000, 0x000};
@ -972,13 +953,7 @@ bool xyzcal_find_bed_induction_sensor_point_xy(void){
pos_i16_t y = _Y;
pos_i16_t z = _Z;
uint8_t point = xyzcal_xycoords2point(x, y);
x = pgm_read_word((uint16_t *)(xyzcal_point_xcoords + point));
y = pgm_read_word((uint16_t *)(xyzcal_point_ycoords + point));
DBG(_n("point=%d x=%d y=%d z=%d\n"), point, x, y, z);
xyzcal_meassure_enter();
xyzcal_lineXYZ_to(x, y, z, 200, 0);
if (xyzcal_searchZ()){
xyzcal_lineXYZ_to(x, y, _Z, 200, 0);
ret = xyzcal_scan_and_process();