From 4a902d082634418e50caf6b881af2c353bf7ae8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Tue, 6 Feb 2024 10:34:49 +0100 Subject: [PATCH] Bugfix for MINP: it is a long When implementing the MINP (MSTA input) it was overseen, that MSTA is defined as 32 bit (where only 15 bits are used). Correct this: use long instead of short. --- motorApp/SoftMotorSrc/devSoft.cc | 2 +- motorApp/SoftMotorSrc/devSoft.h | 2 +- motorApp/SoftMotorSrc/devSoftAux.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/motorApp/SoftMotorSrc/devSoft.cc b/motorApp/SoftMotorSrc/devSoft.cc index 6773f001..aab38523 100644 --- a/motorApp/SoftMotorSrc/devSoft.cc +++ b/motorApp/SoftMotorSrc/devSoft.cc @@ -254,7 +254,7 @@ void soft_dinp_func(struct motorRecord *mr, short newdinp) } } -void soft_minp_func(struct motorRecord *mr, short newminp) +void soft_minp_func(struct motorRecord *mr, long newminp) { msta_field status; unsigned int old_RA_DONE; diff --git a/motorApp/SoftMotorSrc/devSoft.h b/motorApp/SoftMotorSrc/devSoft.h index 4f99e2f0..c000b18b 100644 --- a/motorApp/SoftMotorSrc/devSoft.h +++ b/motorApp/SoftMotorSrc/devSoft.h @@ -57,7 +57,7 @@ struct motor_node { extern long soft_init(int); extern long soft_init_record(void *); extern void soft_dinp_func(struct motorRecord *, short); -extern void soft_minp_func(struct motorRecord *, short); +extern void soft_minp_func(struct motorRecord *, long); extern void soft_rdbl_func(struct motorRecord *, double); extern void soft_rinp_func(struct motorRecord *, long); extern void soft_motor_callback(CALLBACK *); diff --git a/motorApp/SoftMotorSrc/devSoftAux.cc b/motorApp/SoftMotorSrc/devSoftAux.cc index 28943762..780d0d47 100644 --- a/motorApp/SoftMotorSrc/devSoftAux.cc +++ b/motorApp/SoftMotorSrc/devSoftAux.cc @@ -81,7 +81,7 @@ STATIC void soft_dinp(struct event_handler_args args) STATIC void soft_minp(struct event_handler_args args) { - soft_minp_func((struct motorRecord *) args.usr, *((short *) args.dbr)); + soft_minp_func((struct motorRecord *) args.usr, *((long *) args.dbr)); }