steveneads Posted February 17, 2015 Share Posted February 17, 2015 Hi I have a confusion over the correct prototype declaration for a user algo. My function "preProcessFeedback" is running as a "User Servo" for motor 0. It doesn't need to write to a DAC and in fact it's not doing an real motor calculations. I'm running it in the phase cycle with Motor[0].PhaseCtrl = 8, so that it can ruin before the ECT is processed. Originally my prototype for this function was: void preProcessFeedback(struct MotorData *Mptr); EXPORT_SYMBOL(preProcessFeedback); A colleague suggested that it should really be: double preProcessFeedback(struct MotorData *Mptr); EXPORT_SYMBOL(preProcessFeedback); With the latter declaration I added a "return 0" in the function. It seems that in either form the code works - but which is the correct thing to do - or does it matter at all? Link to comment Share on other sites More sharing options...
bradp Posted February 17, 2015 Share Posted February 17, 2015 Technically a user servo returns a double. A user phase return a void which is probably why it is OK. Link to comment Share on other sites More sharing options...
Recommended Posts