forked from epics_driver_modules/motorBase
motorRecord.cc: Make sure that ACCS/ACCU are initialized
When the record is initialized, it could happen that the ACCS field was not initalized at all. Fix this: - Introduce a new value for motorACCSused, motorACCSused_Undef. This is == 0, and temporally used until the record is initilized. Using 0 as Undef will allow a (mis-) use in e.g. CSS to make the ACCS field invisable, whe ACCU is 0 (or not present at all in an older version of the motorRecord) - At the end of check_speed_and_resolution() set ACCS and ACCU, if needed.
This commit is contained in:
@@ -4032,6 +4032,11 @@ static void check_speed_and_resolution(motorRecord * pmr)
|
||||
pmr->hvel = pmr->vbas;
|
||||
else
|
||||
range_check(pmr, &pmr->hvel, pmr->vbas, pmr->vmax);
|
||||
/* Make sure that ACCS/ACCU are initialized */
|
||||
if (pmr->accu == motorACCSused_Undef)
|
||||
{
|
||||
updateACCSfromACCL(pmr);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -70,6 +70,7 @@ menu(motorRMOD) {
|
||||
}
|
||||
|
||||
menu(motorACCSused) {
|
||||
choice(motorACCSused_Undef,"Undef")
|
||||
choice(motorACCSused_Accl, "Accl")
|
||||
choice(motorACCSused_Accs, "Accs")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user