motorRecord: Handle ACCS != 0.0 in init_record

When a database wants to use ACCS from the start, when the record is loaded
into the IOC, the init_record() function needs to look at it.
The new way is to set ACCS != 0.0 and ACCL == 0.0 and then ACCS takes over.
The compatible (call it old ?) way is to have ACCS == 0.0, and then ACCL
is used.
This commit is contained in:
Torsten Bögershausen
2018-12-04 10:47:39 +01:00
parent 36177f7b82
commit 7b87f3b9b6
+8
View File
@@ -3999,6 +3999,14 @@ static void check_speed_and_resolution(motorRecord * pmr)
db_post_events(pmr, &pmr->sbak, DBE_VAL_LOG);
db_post_events(pmr, &pmr->bvel, DBE_VAL_LOG);
if (pmr->accs && !pmr->accl)
{
/* ACCL == 0.0, ACCS is != 0.0 -> Use ACCS
This is a (possible) new way to configure a database.
Existing Db files will have ACCS == 0.0 and this
is backwards compatibleamd behaves as before */
updateACCLfromACCS(pmr);
}
/* Sanity check on acceleration time. */
if (pmr->accl == 0.0)
{