diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2019-07-31 16:59:49 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2019-07-31 16:59:49 +0200 |
commit | 1687222e1b9e74c89cafbb5910e72d8ec7bfd40f (patch) | |
tree | d78102ce30207c63e7608eeba743efd680c888dc /backend/hpsj5s.c | |
parent | 58912f68c2489bcee787599837447e0d64dfd61a (diff) |
New upstream version 1.0.28upstream/1.0.28
Diffstat (limited to 'backend/hpsj5s.c')
-rw-r--r-- | backend/hpsj5s.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/backend/hpsj5s.c b/backend/hpsj5s.c index 9c6ad79..786a8d6 100644 --- a/backend/hpsj5s.c +++ b/backend/hpsj5s.c @@ -1065,7 +1065,7 @@ CalibrateScanElements () SANE_Byte CurrentLowTransferBorder; SANE_Byte CurrentUpSaveBorder; SANE_Byte CurrentLowSaveBorder; - SANE_Byte CurrentSpeed1, CurrentSpeed2; + SANE_Byte CurrentSpeed1, CurrentSpeed2; SANE_Byte CorrectionValue; SANE_Byte FilteredBuffer[2570]; @@ -1167,14 +1167,14 @@ CalibrateScanElements () CallFunctionWithParameter (0x91, 0); /*Stop engine. */ /*Note: if first read failed, junk would be calculated, but if previous - read was succeded, but last one failed, previous data'ld be used. + read was succeeded, but last one failed, previous data'ld be used. */ for(Temp = 0, j = 0; j < 2570; j++) Temp += FilteredBuffer[j]; Temp /= 2570; if((Average == 0)||(Average > Temp)) - Average = Temp; + Average = Temp; } for(Index = 0; Index < 3; Index++) /*Three color components*/ @@ -1190,7 +1190,7 @@ CalibrateScanElements () CallFunctionWithParameter (0x92, CurrentLowTransferBorder|0x80); for(j=2999; j>0; j--) CallFunctionWithParameter (0xC6, 0); - + CurrentUpSaveBorder = arUpSaveBorders[Index]; CallFunctionWithParameter (CurrentUpSaveBorder, 0xFF); @@ -1199,9 +1199,9 @@ CalibrateScanElements () CallFunctionWithParameter (0x90,0); Calibration = 0x80; CallFunctionWithParameter (CurrentUpSaveBorder, 0x80); - + CurrentSpeed1 = CurrentSpeed2 = arSpeeds[Index]; - + for(CorrectionValue = 0x40; CorrectionValue != 0;CorrectionValue >>= 2) { CallFunctionWithParameter (0x91, CurrentSpeed2); @@ -1235,11 +1235,11 @@ CalibrateScanElements () Perhaps, we can optimize it in future.*/ WriteScannerRegister (0x91, 0); usleep(10); - + for(Temp = 0,j = 0; j < 16;j++) Temp += FilteredBuffer[509+j]; /*At this offset calcalates HP's driver.*/ Temp /= 16; - + if(Average > Temp) { Calibration += CorrectionValue; @@ -1247,7 +1247,7 @@ CalibrateScanElements () } else Calibration -= CorrectionValue; - + WriteScannerRegister (CurrentUpSaveBorder, Calibration); }/*By CorrectionValue we tune UpSaveBorder*/ |