[sane-devel] Epson Perfection 2450 and Transparency Unit

Alessandro Zummo azummo-lists at towertech.it
Wed Apr 22 22:39:12 UTC 2009


On Wed, 22 Apr 2009 17:43:46 -0400
Marc Deslauriers <marcdeslauriers at videotron.ca> wrote:

> Yes, I was having this issue only when using the TPU.
> 
> I don't seem to be affected by the second change. It seems to be an
> extra step to detect a TPU, but mine detects fine.

 Can you both try the attached patch?
 
 After the next release, when SANE will have the new status codes,
 I'll backport some parts of from sane evolution which handles
 the warm up issue way better.

diff -u -r1.23 epson2.c
--- backend/epson2.c	25 Feb 2009 02:11:17 -0000	1.23
+++ backend/epson2.c	22 Apr 2009 22:38:01 -0000
@@ -3856,36 +3856,6 @@
 	return status;
 }
 
-/* Helper function to correct the error for warmup lamp
- * gotten from scanners with known buggy firmware.
- * Epson Perfection 4990 Photo
- */
-
-static SANE_Status
-fix_warmup_lamp(Epson_Scanner * s, SANE_Status status)
-{
-	/*
-	 * Check for Perfection 4990 photo/GT-X800 scanner.
-	 * Scanner sometimes report "Fatal error" in status in informationblock when
-	 * lamp warm up. Solution send FS G one more time.
-	 */
-	if (e2_model(s, "GT-X800")) {
-		SANE_Status status2;
-
-		DBG(1, "%s: Epson Perfection 4990 lamp warm up problem \n",
-		    __func__);
-		status2 = e2_wait_warm_up(s);
-		if (status2 == SANE_STATUS_GOOD) {
-			status = e2_start_ext_scan(s);
-			return status;
-		}
-	}
-
-	return status;
-}
-
-
-
 /*
  * This function is part of the SANE API and gets called from the front end to
  * start the scan process.
@@ -4020,20 +3990,29 @@
 	if (dev->extended_commands) {
 		status = e2_start_ext_scan(s);
 
-		/* this is a kind of read request */
-		if (dev->connection == SANE_EPSON_NET)
-			sanei_epson_net_write(s, 0x2000, NULL, 0,
-					      s->ext_block_len + 1, &status);
+		/* check if the scanner signaled a warming up */
+		if (status == SANE_STATUS_IO_ERROR && s->hw->use_extension) {
+		        status = e2_wait_warm_up(s);
+        		if (status == SANE_STATUS_GOOD)
+	        		status = e2_start_ext_scan(s);
+                }
+                                            
 	} else
 		status = e2_start_std_scan(s);
 
 	if (status != SANE_STATUS_GOOD) {
 		DBG(1, "%s: start failed: %s\n", __func__,
 		    sane_strstatus(status));
-		if (status == SANE_STATUS_IO_ERROR)
-			status = fix_warmup_lamp(s, status);
+
+		return status;
 	}
 
+	/* this is a kind of read request */
+	if (dev->connection == SANE_EPSON_NET) {
+		sanei_epson_net_write(s, 0x2000, NULL, 0,
+		      s->ext_block_len + 1, &status);
+        }
+        
 	return status;
 }
 


-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it




More information about the sane-devel mailing list