From 4a197dcd734123538bb81c4a0c10ba491a23ca75 Mon Sep 17 00:00:00 2001 From: Ron Sluiter Date: Wed, 14 Jun 2000 15:11:37 +0000 Subject: [PATCH] - Removed unused command type, QUERY. - Added support for unsolicited controller responses. --- motorApp/MotorSrc/motordrvCom.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/motorApp/MotorSrc/motordrvCom.c b/motorApp/MotorSrc/motordrvCom.c index d24e5167..8c4c90af 100644 --- a/motorApp/MotorSrc/motordrvCom.c +++ b/motorApp/MotorSrc/motordrvCom.c @@ -3,9 +3,9 @@ FILENAME... motordrvCom.c USAGE... This file contains driver functions that are common to all motor record driver modules. -Version: $Revision: 1.2 $ +Version: $Revision: 1.3 $ Modified By: $Author: sluiter $ -Last Modified: $Date: 2000-03-03 22:18:30 $ +Last Modified: $Date: 2000-06-14 15:11:37 $ */ /* @@ -246,20 +246,18 @@ static void process_messages(struct driver_table *tabptr, ULONG tick) (node->signal >= 0 && node->signal < (*tabptr->card_array)[node->card]->total_axis)) { struct mess_info *motor_info; + struct controller *brdptr; motor_info = &((*tabptr->card_array)[node->card]->motor_info[node->signal]); motor_motion = motor_info->motor_motion; + brdptr = (*tabptr->card_array)[node->card]; switch (node->type) { - case QUERY: - (*tabptr->sendmsg) (node->card, node->message, (char) NULL); - (*tabptr->getmsg) (node->card, node->message, 1); - callbackRequest((CALLBACK *) node); - break; - case VELOCITY: (*tabptr->sendmsg) (node->card, node->message, (char) NULL); + if (brdptr->cmnd_response == ON) + (*tabptr->getmsg) (node->card, node->message, 1); /* * this is tricky - another motion is here there is a very @@ -286,6 +284,8 @@ static void process_messages(struct driver_table *tabptr, ULONG tick) case MOTION: (*tabptr->sendmsg) (node->card, node->message, (char) NULL); + if (brdptr->cmnd_response == ON) + (*tabptr->getmsg) (node->card, node->message, 1); /* this is tricky - see velocity comment */ if (!motor_motion) /* if NULL */ @@ -332,11 +332,15 @@ static void process_messages(struct driver_table *tabptr, ULONG tick) case MOVE_TERM: (*tabptr->sendmsg) (node->card, node->message, (char) NULL); + if (brdptr->cmnd_response == ON) + (*tabptr->getmsg) (node->card, node->message, 1); motor_free(node, tabptr); /* free message buffer */ break; default: (*tabptr->sendmsg) (node->card, node->message, (char) NULL); + if (brdptr->cmnd_response == ON) + (*tabptr->getmsg) (node->card, node->message, 1); motor_free(node, tabptr); /* free message buffer */ motor_info->status_delay = tick; break; @@ -418,7 +422,6 @@ int motor_send(struct mess_node *u_msg, struct driver_table *tabptr, char *cmnd_ break; case VELOCITY: case IMMEDIATE: - case QUERY: case INFO: break; default: