Index: firmware/App/Services/PIControllers.c =================================================================== diff -u -r3ed56772e4ca7f562dd3647ee56396d63ea0a077 -rdfc26c678cd9f0e2a2dda1d16a8d6b5f6660d689 --- firmware/App/Services/PIControllers.c (.../PIControllers.c) (revision 3ed56772e4ca7f562dd3647ee56396d63ea0a077) +++ firmware/App/Services/PIControllers.c (.../PIControllers.c) (revision dfc26c678cd9f0e2a2dda1d16a8d6b5f6660d689) @@ -27,6 +27,8 @@ // ********** private definitions ********** +#define MAX_ILIMIT 1.0F ///< Controller max Ilimit/maxErrorSumStep. + /// Enumeration of PI controller direction. typedef enum controller_Directions { @@ -285,27 +287,26 @@ * @brief * The getPIControllerSignals function returns the latest requested signal sample. * @details Inputs: none - * @details Outputs: none + * @details Outputs: maxErrorSumStep of controller ID * @param controllerID ID filter number - * @param signalID signal sample ID request + * @param stepLimit maximum step limit * @return latest sample requested *************************************************************************/ void setPIControllerStepLimit( PI_CONTROLLER_ID_T controllerID, F32 stepLimit ) { PI_CONTROLLER_T *controller; - F32 maxStepLimit = 1.0; if ( controllerID < NUM_OF_PI_CONTROLLERS_IDS ) { SET_CONTROLLER( controller, controllerID ); - if ( ( stepLimit > NEARLY_ZERO ) && ( stepLimit < maxStepLimit ) ) + if ( ( stepLimit > NEARLY_ZERO ) && ( stepLimit < MAX_ILIMIT ) ) { controller->maxErrorSumStep = stepLimit; } else { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_PI_CTRL_INVALID_SIGNAL, (U32)signalID ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_PI_CTRL_INVALID_STEP_LIMIT, (U32)stepLimit ) } }