From fab55c629d74104df1de8c0b6cd4a032d772c7fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Voltz?= Date: Sat, 31 May 2014 07:13:46 +0200 Subject: [PATCH] ensure target speed is reached - in case the motor profile table doesn't contain target speed, add it to have accurate scanning resolution --- backend/genesys_low.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/genesys_low.c b/backend/genesys_low.c index 23139ed0e..63420e4f0 100644 --- a/backend/genesys_low.c +++ b/backend/genesys_low.c @@ -1650,7 +1650,7 @@ Motor_Profile *profile; i=0; sum=0; - /* first step is used unmodified */ + /* first step is always used unmodified */ current=profile->table[0]; /* loop on profile copying and apply step type */ @@ -1662,6 +1662,14 @@ Motor_Profile *profile; current=profile->table[i]>>step_type; } + /* ensure last step is required speed in case profile doesn't contain it */ + if(current!=0 && currenttable[i]==0 && DBG_LEVEL >= DBG_warn && current>target) {