genesys: Simplify use of pixel_endx on gl124

merge-requests/213/head^2
Povilas Kanapickas 2020-04-13 07:19:59 +03:00
rodzic cdefc1cae5
commit 3693f4b12d
2 zmienionych plików z 5 dodań i 12 usunięć

Wyświetl plik

@ -792,8 +792,12 @@ static void gl124_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
}
}
std::uint32_t pixel_endx = session.pixel_endx;
if (pixel_endx == reg->get24(REG_SEGCNT)) {
pixel_endx = 0;
}
reg->set24(REG_STRPIXEL, session.pixel_startx);
reg->set24(REG_ENDPIXEL, session.pixel_endx);
reg->set24(REG_ENDPIXEL, pixel_endx);
dev->line_count = 0;
@ -1150,10 +1154,6 @@ void CommandSetGl124::send_shading_data(Genesys_Device* dev, const Genesys_Senso
std::uint32_t strpixel = dev->session.pixel_startx;
std::uint32_t endpixel = dev->session.pixel_endx;
segcnt = dev->reg.get24(REG_SEGCNT);
if(endpixel==0)
{
endpixel=segcnt;
}
/* turn pixel value into bytes 2x16 bits words */
strpixel*=2*2; /* 2 words of 2 bytes */

Wyświetl plik

@ -929,13 +929,6 @@ void compute_session_pixel_offsets(const Genesys_Device* dev, ScanSession& s,
s.pixel_startx++;
s.pixel_endx++;
}
std::uint32_t segcnt = (sensor.custom_regs.get_value(gl124::REG_SEGCNT) << 16) +
(sensor.custom_regs.get_value(gl124::REG_SEGCNT + 1) << 8) +
sensor.custom_regs.get_value(gl124::REG_SEGCNT + 2);
if (s.pixel_endx == segcnt) {
s.pixel_endx = 0;
}
}
}