Index: Common.h =================================================================== diff -u -r5522c7962c9519b92fc35ee1aac72aedf230d4b1 -rc8d764933ccdc4a185131d77bbcc106a9223ae6b --- Common.h (.../Common.h) (revision 5522c7962c9519b92fc35ee1aac72aedf230d4b1) +++ Common.h (.../Common.h) (revision c8d764933ccdc4a185131d77bbcc106a9223ae6b) @@ -197,18 +197,15 @@ #define RAD2DEG(r) ((r) * 180.0F / PI) ///< Macro converts radians to degrees #define BIT(nr) (1UL << (nr)) ///< Macro for bit mask #define BITS_PER_LONG 32 -#define GENMASK(h, l) \ - (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) ///< Macro for generating bit mask -#define BIT0 0 -#define BIT1 1 -#define BIT2 2 -#define BIT3 3 -#define BIT4 4 -#define BIT5 5 -#define BIT6 6 -#define BIT7 7 -#define BIT8 8 +#define BIT0 0 ///< Macro for bit position 0 +#define BIT1 1 ///< Macro for bit position 1 +#define BIT2 2 ///< Macro for bit position 2 +#define BIT3 3 ///< Macro for bit position 3 +#define BIT4 4 ///< Macro for bit position 4 +#define BIT5 5 ///< Macro for bit position 5 +#define BIT6 6 ///< Macro for bit position 6 +#define BIT7 7 ///< Macro for bit position 7 /// Macro to set a specific alarm with 1 piece of unsigned 32-bit alarm data. #define SET_ALARM_WITH_1_U32_DATA(a,d1) { \ Index: PIControllers.c =================================================================== diff -u -r5522c7962c9519b92fc35ee1aac72aedf230d4b1 -rc8d764933ccdc4a185131d77bbcc106a9223ae6b --- PIControllers.c (.../PIControllers.c) (revision 5522c7962c9519b92fc35ee1aac72aedf230d4b1) +++ PIControllers.c (.../PIControllers.c) (revision c8d764933ccdc4a185131d77bbcc106a9223ae6b) @@ -154,7 +154,6 @@ controller->controlSignal = RANGE( initialControlSignal, controller->uMin, controller->uMax ); controller->referenceSignal = 0.0; controller->errorSignal = 0.0; - // TODO: controller->errorSum = controller->controlSignal / ( controller->Ki + controller->Kp ); controller->errorSum = controller->controlSignal / controller->Ki; controller->errorSumBeforeWindUp = controller->errorSum; controller->measuredSignal = 0.0; @@ -380,6 +379,10 @@ { // Invalid controller given #ifdef _DD_ SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_PI_CTRL_INVALID_CONTROLLER, (U32)controllerID ) +#elif _TD_ + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_PI_CTRL_INVALID_CONTROLLER, (U32)controllerID ) +#else + #error "Unsupported platform" #endif }