mirror of
				https://github.com/Klipper3d/klipper.git
				synced 2025-10-31 02:15:52 +01:00 
			
		
		
		
	input_shaper: Fix for polar kinematics
Forward post_cb calls from itersolve to the original kinematics. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
This commit is contained in:
		
				
					committed by
					
						 KevinOConnor
						KevinOConnor
					
				
			
			
				
	
			
			
			
						parent
						
							fbd5b49215
						
					
				
				
					commit
					47aa28e530
				
			| @@ -156,6 +156,16 @@ shaper_xy_calc_position(struct stepper_kinematics *sk, struct move *m | |||||||
|     return is->orig_sk->calc_position_cb(is->orig_sk, &is->m, DUMMY_T); |     return is->orig_sk->calc_position_cb(is->orig_sk, &is->m, DUMMY_T); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // A callback that forwards post_cb call to the original kinematics | ||||||
|  | static void | ||||||
|  | shaper_commanded_pos_post_fixup(struct stepper_kinematics *sk) | ||||||
|  | { | ||||||
|  |     struct input_shaper *is = container_of(sk, struct input_shaper, sk); | ||||||
|  |     is->orig_sk->commanded_pos = sk->commanded_pos; | ||||||
|  |     is->orig_sk->post_cb(is->orig_sk); | ||||||
|  |     sk->commanded_pos = is->orig_sk->commanded_pos; | ||||||
|  | } | ||||||
|  |  | ||||||
| int __visible | int __visible | ||||||
| input_shaper_set_sk(struct stepper_kinematics *sk | input_shaper_set_sk(struct stepper_kinematics *sk | ||||||
|                     , struct stepper_kinematics *orig_sk) |                     , struct stepper_kinematics *orig_sk) | ||||||
| @@ -174,6 +184,9 @@ input_shaper_set_sk(struct stepper_kinematics *sk | |||||||
|     is->sk.commanded_pos = orig_sk->commanded_pos; |     is->sk.commanded_pos = orig_sk->commanded_pos; | ||||||
|     is->sk.last_flush_time = orig_sk->last_flush_time; |     is->sk.last_flush_time = orig_sk->last_flush_time; | ||||||
|     is->sk.last_move_time = orig_sk->last_move_time; |     is->sk.last_move_time = orig_sk->last_move_time; | ||||||
|  |     if (orig_sk->post_cb) { | ||||||
|  |         is->sk.post_cb = shaper_commanded_pos_post_fixup; | ||||||
|  |     } | ||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user