kopia lustrzana https://gitlab.com/sane-project/backends
				
				
				
			Merge branch 'genesys-fix-gl646-scanning' into 'master'
genesys: Work around invalid acceleration curves on certain gl646 scanners See merge request sane-project/backends!278merge-requests/213/head
						commit
						4bf176c73e
					
				|  | @ -350,11 +350,19 @@ void CommandSetGl646::init_regs_for_scan_session(Genesys_Device* dev, const Gene | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|   /* motor steps used */ |   /* motor steps used */ | ||||||
|     regs->find_reg(0x21).value = slope_table1.steps_count; |  | ||||||
|     regs->find_reg(0x24).value = slope_table2.steps_count; |  | ||||||
| 
 |  | ||||||
|     unsigned forward_steps = motor->fwdbwd; |     unsigned forward_steps = motor->fwdbwd; | ||||||
|     unsigned backward_steps = motor->fwdbwd; |     unsigned backward_steps = motor->fwdbwd; | ||||||
|  | 
 | ||||||
|  |     // the steps count must be different by at most 128, otherwise it's impossible to construct
 | ||||||
|  |     // a proper backtracking curve. We're using slightly lower limit to allow at least a minimum
 | ||||||
|  |     // distance between accelerations (forward_steps, backward_steps)
 | ||||||
|  |     if (slope_table1.steps_count > slope_table2.steps_count + 100) { | ||||||
|  |         slope_table2.steps_count += slope_table1.steps_count - 100; | ||||||
|  |     } | ||||||
|  |     if (slope_table2.steps_count > slope_table1.steps_count + 100) { | ||||||
|  |         slope_table1.steps_count += slope_table2.steps_count - 100; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     if (slope_table1.steps_count >= slope_table2.steps_count) { |     if (slope_table1.steps_count >= slope_table2.steps_count) { | ||||||
|         backward_steps += (slope_table1.steps_count - slope_table2.steps_count) * 2; |         backward_steps += (slope_table1.steps_count - slope_table2.steps_count) * 2; | ||||||
|     } else { |     } else { | ||||||
|  | @ -374,6 +382,8 @@ void CommandSetGl646::init_regs_for_scan_session(Genesys_Device* dev, const Gene | ||||||
|         forward_steps -= backward_steps - 255; |         forward_steps -= backward_steps - 255; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     regs->find_reg(0x21).value = slope_table1.steps_count; | ||||||
|  |     regs->find_reg(0x24).value = slope_table2.steps_count; | ||||||
|     regs->find_reg(0x22).value = forward_steps; |     regs->find_reg(0x22).value = forward_steps; | ||||||
|     regs->find_reg(0x23).value = backward_steps; |     regs->find_reg(0x23).value = backward_steps; | ||||||
| 
 | 
 | ||||||
|  | @ -1391,6 +1401,11 @@ static void end_scan_impl(Genesys_Device* dev, Genesys_Register_Set* reg, bool c | ||||||
|         } |         } | ||||||
|         wait_limit_seconds = 3; |         wait_limit_seconds = 3; | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     if (is_testing_mode()) { | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     if (check_stop) { |     if (check_stop) { | ||||||
|         for (unsigned i = 0; i < wait_limit_seconds * 10; i++) { |         for (unsigned i = 0; i < wait_limit_seconds * 10; i++) { | ||||||
|             if (scanner_is_motor_stopped(*dev)) { |             if (scanner_is_motor_stopped(*dev)) { | ||||||
|  |  | ||||||
		Ładowanie…
	
		Reference in New Issue
	
	 Povilas Kanapickas
						Povilas Kanapickas