motorRecord: Reset UEIP to No if no encoder is present

When a database is loaded with UEIP=Yes and the controller says that there is no
encoder present, reset UEIP to No
This commit is contained in:
Torsten Bögershausen
2021-11-17 08:39:26 +01:00
parent 6d127cd6f4
commit 24a53e660e
+6
View File
@@ -3633,6 +3633,12 @@ static void process_motor_info(motorRecord * pmr, bool initcall)
/* Calculate raw and dial readback values. */
msta.All = pmr->msta;
if ((pmr->ueip == motorUEIP_Yes) && (!(msta.Bits.EA_PRESENT)))
{
pmr->ueip = motorUEIP_No;
db_post_events(pmr, &pmr->urip, DBE_VAL_LOG);
}
if (pmr->ueip == motorUEIP_Yes)
{
/* An encoder is present and the user wants us to use it. */