Merge pull request #597 from XPila/MK25

XYZcal fix
This commit is contained in:
PavelSindler 2018-04-03 20:55:21 +02:00 committed by GitHub
commit cfa72c3f10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -2035,7 +2035,11 @@ BedSkewOffsetDetectionResultType find_bed_offset_and_skew(int8_t verbosity_level
// SERIAL_ECHO(int(verbosity_level));
// SERIAL_ECHOPGM("");
#ifdef NEW_XYZCAL
{
#else //NEW_XYZCAL
while (iteration < 3) {
#endif //NEW_XYZCAL
SERIAL_ECHOPGM("Iteration: ");
MYSERIAL.println(int(iteration + 1));

View File

@ -370,7 +370,7 @@ void xyzcal_adjust_pixels(uint8_t* pixels, uint16_t* histo)
{
uint8_t l;
uint16_t max_c = histo[0];
uint8_t max_l = 0;
uint8_t max_l = 1;
for (l = 1; l < 16; l++)
{
uint16_t c = histo[l];
@ -384,7 +384,7 @@ void xyzcal_adjust_pixels(uint8_t* pixels, uint16_t* histo)
for (l = 15; l > 8; l--)
if (histo[l] >= 10)
break;
uint8_t pix_min = (max_l + 2) << 4;
uint8_t pix_min = (max_l + 1) << 4;
uint8_t pix_max = l << 4;
uint8_t pix_dif = pix_max - pix_min;
DBG(_n(" min=%d max=%d dif=%d\n"), pix_min, pix_max, pix_dif);
@ -425,7 +425,7 @@ void xyzcal_draw_pattern_12x12_in_32x32(uint8_t* pattern, uint32_t* pixels, int
int16_t xyzcal_match_pattern_12x12_in_32x32(uint16_t* pattern, uint8_t* pixels, uint8_t c, uint8_t r)
{
uint8_t thr = 32;
uint8_t thr = 16;
int16_t match = 0;
for (uint8_t i = 0; i < 12; i++)
for (uint8_t j = 0; j < 12; j++)