-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev asyn motor remove init event #1
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asynPrint formats should be changed
motorApp/MotorSrc/devMotorAsyn.c
Outdated
pmr->name, setPos ); | ||
} else { | ||
asynPrint(pasynUser, ASYN_TRACE_FLOW, | ||
"devMotorAsyn::init_controller, %s set position to %f\n", | ||
"devMotorAsyn::init_controller, %s set position to %2.6lf\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%lf is not a correct format for printf(). It should just be %f. I don't think we should be giving precision and width, we don't know the magnitude of these values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review, @MarkRivers
I agree that the %f should be the default for a generic code base.
A new version had been pushed.
Unless we introduce a macro/#define and make the configurable, but that is another story.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see even the version for upstream motor:
epics-modules/motor#167
When the motorRecord is initialized, init_record() is called. For asynMotors init_record() calls init_controller() in devMotorAsyn.c From here, the encoder ratio is send to the driver. After doing that, the code "locks" the execution waiting for a callback to call epicsEventSignal(pPvt->initEvent) which "unlocks" the code. As Mark Clift points out, this code can be simplified and the initEvent can be removed. Mark Rivers suggested to use the asynFloat64SyncIO interface, which locks the asyn port when calling the driver.
…nitEvent Conflicts: motorApp/MotorSrc/devMotorAsyn.c
0595f69
to
8dee7bf
Compare
No description provided.