Re: musteka4s2

From: Jochen Eisinger (jochen.eisinger@gmx.net)
Date: Sun Jan 09 2000 - 04:55:58 PST

  • Next message: Bernd Schroeder: "Re: Phantom 636cx and microtek2"

    Jeff DeFouw wrote:

    > Would the people using musteka4s2, specifically those with problems, give
    > me some system information? What system processors do you have (Intel P3,
    > AMD K6, etc)? The delays so far haven't shown effective.

    Err, 486DX2-66 - greetings from the past and a Intel Pentium (first release,
    the one with the famous bug).... running RedHat linux 5.1 with sane 1.0.1...
    my scanner is a medion flatbed scanner, the windows-vxd function
    GetDeviceInfo says "Printer Scanner 1.00 Mustek MFS-600IIIP", the windows
    file title of the vxd-driver is "A4SII300 EPP SCAN Device", asic-id is 0A5h,
    ccdtype 0. More infos needed?

    I have made same changes to your backend, Jeff. When compiled with -DNO_CALIB
    the backend produces now pictures but the colors are all wrong. Something in
    the initialization stage still must be wrong because the function calibrate()
    (which seems to work properly) calculates a BlackRef of #204... not quite
    possible...

    the diff-file attached to this mail apllies to the package
    musteka4s2debug.tar.gz

    --
    Don't throw your PC
    out of the window throw Window's out of your PC.
    

    --- musteka4s2.c Sun Jan 9 12:57:12 2000 +++ musteka4s2.c Sun Jan 9 12:54:57 2000 @@ -541,10 +541,6 @@ { unsigned short Base = IO->ParBase; - outb(0x00, Base); - outb(0x04, Base+2); - outb(0x06, Base+2); - outb(0x04, Base+2); outb(PreLock[2] & 0x0F, Base+2); outb(0x15, Base); outb(0x95, Base); @@ -709,6 +705,8 @@ fprintf(stderr, "libsane-musteka4s2: debug: CCD Type: %02X\n", dev->CCDType); *h = dev; + + unlock_port(&dev->IO, dev->PreLock); return(SANE_STATUS_GOOD); } @@ -877,7 +875,9 @@ if (dev->ASIC_ID == A4S2_ASIC_ID_1015) { ChanCode ^= 0x02; - ChanCode |= dev->ImageControl & 0xE4; + dev->ImageControl &= 0x34; + ChanCode |= dev->ImageControl; + dev->ImageControl = ChanCode; } dev->IO.writebyte(&dev->IO, 6, ChanCode); } @@ -953,7 +953,7 @@ ExposeTime = 0x70; break; case A4S2_ASIC_ID_1015: - dev->ImageControl = 0; + dev->ImageControl = 4; switch (dev->CCD.Mode) { case A4S2_MODE_LINEART: case A4S2_MODE_GRAY: @@ -965,12 +965,15 @@ set_ccd_channel(dev, A4S2_CHANNEL_RED); break; } - IO->writebyte(IO, 6, (dev->ImageControl & 0xE4) | (dev->CCD.Invert ? 0x10 : 0x00)); + dev->ImageControl &= 0xE4; + dev->ImageControl |= (dev->CCD.Invert ? 0x10 : 0x00); + IO->writebyte(IO, 6, dev->ImageControl & 0xE4); IO->writebyte(IO, 6, 0x23); IO->writebyte(IO, 5, 0x00); IO->writebyte(IO, 6, 0x43); + if (dev->CCDType == 0) + ExposeTime = 0x8A; switch (dev->CCDType) { - case 0: ExposeTime = 0x8A; break; case 1: IO->writebyte(IO, 5, 0x6B); break; case 4: IO->writebyte(IO, 5, 0x9F); break; default: IO->writebyte(IO, 5, 0x92); break; @@ -1014,8 +1017,10 @@ IO->readend(IO); if (dev->ASIC_ID == A4S2_ASIC_ID_1015) { Status >>= 1; - } else + Status ^= 0xFF; + } else { Status ^= 0xFF; + } Status &= 0x01; return(Status); } @@ -1243,6 +1248,7 @@ BlackPos = 0x6A; CCD.SkipCount = (BlackPos + 12) & 0xFF; + for (i = 0; i < 4; i++) { motor_forward(dev); load_channel(dev, A4S2_CHANNEL_GRAY); @@ -1362,6 +1368,7 @@ dev->Params.pixels_per_line = saved_ppl; dev->CCD = CCD; config_ccd(dev); + } static unsigned char Voltages_3599[] = { 92, 90, 99 }; @@ -1398,7 +1405,8 @@ } dev->IO.writebyte(&dev->IO, 6, 0x00); - get_bank_count(dev); /* Should probably error if not 0 */ + if (get_bank_count(dev)) + return SANE_STATUS_DEVICE_BUSY; /* Should probably error if not 0 */ return_home(dev); @@ -1413,6 +1421,8 @@ memset(dev->CalibB, 0, dev->Params.pixels_per_line); } + calibrate(dev); + if (dev->CCDType == 1) { dev->IO.writebyte(&dev->IO, 6, 0x15); /* set pixel average */ dev->BlueOffset = 4; @@ -1422,7 +1432,6 @@ dev->GreenOffset = 16; } - calibrate(dev); for (i = 0; i < 56 + dev->TopY - (dev->CCD.Mode == A4S2_MODE_COLOR ? dev->GreenOffset : 0); i++) { motor_forward(dev); @@ -1464,6 +1473,13 @@ unsigned short SkipsLeft = dev->AdjustedSkip + 1; int hw_pos = 0; int buf_pos = 0; + + + #ifdef NO_CALIB + RefBlack=0; + CalibP=NULL; + #endif + if (count == 0) return;

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Sun Jan 09 2000 - 04:46:29 PST