diff --git a/bacnet-stack/demo/object/ai.c b/bacnet-stack/demo/object/ai.c index e010d62c..aeea9991 100644 --- a/bacnet-stack/demo/object/ai.c +++ b/bacnet-stack/demo/object/ai.c @@ -34,6 +34,9 @@ #include "config.h" /* the custom stuff */ #include "ai.h" +#ifndef MAX_ANALOG_INPUTS +#define MAX_ANALOG_INPUTS 4 +#endif static float Present_Value[MAX_ANALOG_INPUTS]; diff --git a/bacnet-stack/demo/object/ao.c b/bacnet-stack/demo/object/ao.c index 0203b3d0..17af1dad 100644 --- a/bacnet-stack/demo/object/ao.c +++ b/bacnet-stack/demo/object/ao.c @@ -37,6 +37,10 @@ #include "ao.h" #include "handlers.h" +#ifndef MAX_ANALOG_OUTPUTS +#define MAX_ANALOG_OUTPUTS 4 +#endif + /* we choose to have a NULL level in our system represented by */ /* a particular value. When the priorities are not in use, they */ /* will be relinquished (i.e. set to the NULL level). */ diff --git a/bacnet-stack/demo/object/av.c b/bacnet-stack/demo/object/av.c index 7d6344fa..0bc4812d 100644 --- a/bacnet-stack/demo/object/av.c +++ b/bacnet-stack/demo/object/av.c @@ -37,6 +37,10 @@ #include "av.h" #include "handlers.h" +#ifndef MAX_ANALOG_VALUES +#define MAX_ANALOG_VALUES 4 +#endif + /* we choose to have a NULL level in our system represented by */ /* a particular value. When the priorities are not in use, they */ /* will be relinquished (i.e. set to the NULL level). */ diff --git a/bacnet-stack/demo/object/bi.c b/bacnet-stack/demo/object/bi.c index f4de1db8..407c0ce2 100644 --- a/bacnet-stack/demo/object/bi.c +++ b/bacnet-stack/demo/object/bi.c @@ -39,6 +39,10 @@ #include "bi.h" #include "handlers.h" +#ifndef MAX_BINARY_INPUTS +#define MAX_BINARY_INPUTS 5 +#endif + /* stores the current value */ static BACNET_BINARY_PV Present_Value[MAX_BINARY_INPUTS]; /* out of service decouples physical input from Present_Value */ diff --git a/bacnet-stack/demo/object/bo.c b/bacnet-stack/demo/object/bo.c index 0c48ce34..995e8869 100644 --- a/bacnet-stack/demo/object/bo.c +++ b/bacnet-stack/demo/object/bo.c @@ -38,6 +38,10 @@ #include "bo.h" #include "handlers.h" +#ifndef MAX_BINARY_OUTPUTS +#define MAX_BINARY_OUTPUTS 4 +#endif + /* When all the priorities are level null, the present value returns */ /* the Relinquish Default value */ #define RELINQUISH_DEFAULT BINARY_INACTIVE diff --git a/bacnet-stack/demo/object/bv.c b/bacnet-stack/demo/object/bv.c index 564ad438..0a5978ec 100644 --- a/bacnet-stack/demo/object/bv.c +++ b/bacnet-stack/demo/object/bv.c @@ -38,6 +38,10 @@ #include "bv.h" #include "handlers.h" +#ifndef MAX_BINARY_VALUES +#define MAX_BINARY_VALUES 10 +#endif + /* When all the priorities are level null, the present value returns */ /* the Relinquish Default value */ #define RELINQUISH_DEFAULT BINARY_INACTIVE diff --git a/bacnet-stack/demo/object/lc.c b/bacnet-stack/demo/object/lc.c index adbfaedb..c699b9f2 100644 --- a/bacnet-stack/demo/object/lc.c +++ b/bacnet-stack/demo/object/lc.c @@ -42,7 +42,9 @@ #include "handlers.h" /* number of demo objects */ +#ifndef MAX_LOAD_CONTROLS #define MAX_LOAD_CONTROLS 4 +#endif /* indicates the current load shedding state of the object */ static BACNET_SHED_STATE Present_Value[MAX_LOAD_CONTROLS]; diff --git a/bacnet-stack/demo/object/lo.c b/bacnet-stack/demo/object/lo.c index 6544ec12..926c9a63 100644 --- a/bacnet-stack/demo/object/lo.c +++ b/bacnet-stack/demo/object/lo.c @@ -46,7 +46,9 @@ #include "handlers.h" >>>>>>> .r1574 +#ifndef MAX_LIGHTING_OUTPUTS #define MAX_LIGHTING_OUTPUTS 5 +#endif /* we choose to have a NULL level in our system represented by */ /* a particular value. When the priorities are not in use, they */ diff --git a/bacnet-stack/demo/object/lsp.c b/bacnet-stack/demo/object/lsp.c index 5148fb61..d731442f 100644 --- a/bacnet-stack/demo/object/lsp.c +++ b/bacnet-stack/demo/object/lsp.c @@ -38,6 +38,10 @@ #include "lsp.h" #include "handlers.h" +#ifndef MAX_LIFE_SAFETY_POINTS +#define MAX_LIFE_SAFETY_POINTS 7 +#endif + /* Here are our stored levels.*/ static BACNET_LIFE_SAFETY_MODE Life_Safety_Point_Mode[MAX_LIFE_SAFETY_POINTS]; static BACNET_LIFE_SAFETY_STATE diff --git a/bacnet-stack/demo/object/ms-input.c b/bacnet-stack/demo/object/ms-input.c index fd55d9aa..b405e361 100644 --- a/bacnet-stack/demo/object/ms-input.c +++ b/bacnet-stack/demo/object/ms-input.c @@ -38,6 +38,11 @@ #include "ms-input.h" #include "handlers.h" +/* number of demo objects */ +#ifndef MAX_MULTISTATE_INPUTS +#define MAX_MULTISTATE_INPUTS 1 +#endif + /* how many states? 0-253 is 254 states */ #ifndef MULTISTATE_NUMBER_OF_STATES #define MULTISTATE_NUMBER_OF_STATES (254) diff --git a/bacnet-stack/demo/object/mso.c b/bacnet-stack/demo/object/mso.c index dd3c306d..c229cb5d 100644 --- a/bacnet-stack/demo/object/mso.c +++ b/bacnet-stack/demo/object/mso.c @@ -38,6 +38,10 @@ #include "mso.h" #include "handlers.h" +#ifndef MAX_MULTISTATE_OUTPUTS +#define MAX_MULTISTATE_OUTPUTS 4 +#endif + /* When all the priorities are level null, the present value returns */ /* the Relinquish Default value */ #define MULTISTATE_RELINQUISH_DEFAULT 0 diff --git a/bacnet-stack/demo/object/trendlog.c b/bacnet-stack/demo/object/trendlog.c index 052008f6..b1a53c04 100644 --- a/bacnet-stack/demo/object/trendlog.c +++ b/bacnet-stack/demo/object/trendlog.c @@ -44,8 +44,12 @@ #include "bacfile.h" /* object list dependency */ #endif -/* Error code for Trend Log storage */ +/* number of demo objects */ +#ifndef MAX_TREND_LOGS +#define MAX_TREND_LOGS 8 +#endif +/* Error code for Trend Log storage */ typedef struct tl_error { uint16_t usClass; uint16_t usCode; diff --git a/bacnet-stack/include/ai.h b/bacnet-stack/include/ai.h index 84854a86..fc498a10 100644 --- a/bacnet-stack/include/ai.h +++ b/bacnet-stack/include/ai.h @@ -30,10 +30,6 @@ #include "bacdef.h" #include "rp.h" -#ifndef MAX_ANALOG_INPUTS -#define MAX_ANALOG_INPUTS 4 -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/bacnet-stack/include/ao.h b/bacnet-stack/include/ao.h index 64130ead..dcd377c5 100644 --- a/bacnet-stack/include/ao.h +++ b/bacnet-stack/include/ao.h @@ -32,10 +32,6 @@ #include "rp.h" #include "wp.h" -#ifndef MAX_ANALOG_OUTPUTS -#define MAX_ANALOG_OUTPUTS 4 -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/bacnet-stack/include/av.h b/bacnet-stack/include/av.h index 4ac70646..38ec2fd9 100644 --- a/bacnet-stack/include/av.h +++ b/bacnet-stack/include/av.h @@ -32,10 +32,6 @@ #include "wp.h" #include "rp.h" -#ifndef MAX_ANALOG_VALUES -#define MAX_ANALOG_VALUES 4 -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/bacnet-stack/include/bi.h b/bacnet-stack/include/bi.h index 7e1190b3..6c82f75f 100644 --- a/bacnet-stack/include/bi.h +++ b/bacnet-stack/include/bi.h @@ -32,10 +32,6 @@ #include "rp.h" #include "wp.h" -#ifndef MAX_BINARY_INPUTS -#define MAX_BINARY_INPUTS 5 -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/bacnet-stack/include/bo.h b/bacnet-stack/include/bo.h index eca98226..f45738f6 100644 --- a/bacnet-stack/include/bo.h +++ b/bacnet-stack/include/bo.h @@ -32,10 +32,6 @@ #include "rp.h" #include "wp.h" -#ifndef MAX_BINARY_OUTPUTS -#define MAX_BINARY_OUTPUTS 4 -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/bacnet-stack/include/bv.h b/bacnet-stack/include/bv.h index 2b908303..9184a4f3 100644 --- a/bacnet-stack/include/bv.h +++ b/bacnet-stack/include/bv.h @@ -32,10 +32,6 @@ #include "rp.h" #include "wp.h" -#ifndef MAX_BINARY_VALUES -#define MAX_BINARY_VALUES 10 -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/bacnet-stack/include/lsp.h b/bacnet-stack/include/lsp.h index b37ea395..63ceb856 100644 --- a/bacnet-stack/include/lsp.h +++ b/bacnet-stack/include/lsp.h @@ -32,10 +32,6 @@ #include "rp.h" #include "wp.h" -#ifndef MAX_LIFE_SAFETY_POINTS -#define MAX_LIFE_SAFETY_POINTS 7 -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/bacnet-stack/include/ms-input.h b/bacnet-stack/include/ms-input.h index 97b3af3f..e79c5181 100644 --- a/bacnet-stack/include/ms-input.h +++ b/bacnet-stack/include/ms-input.h @@ -32,10 +32,6 @@ #include "rp.h" #include "wp.h" -#ifndef MAX_MULTISTATE_INPUTS -#define MAX_MULTISTATE_INPUTS 1 -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/bacnet-stack/include/mso.h b/bacnet-stack/include/mso.h index 57df4af7..6829bd56 100644 --- a/bacnet-stack/include/mso.h +++ b/bacnet-stack/include/mso.h @@ -32,10 +32,6 @@ #include "rp.h" #include "wp.h" -#ifndef MAX_MULTISTATE_OUTPUTS -#define MAX_MULTISTATE_OUTPUTS 4 -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/bacnet-stack/include/trendlog.h b/bacnet-stack/include/trendlog.h index ff390139..60d15812 100644 --- a/bacnet-stack/include/trendlog.h +++ b/bacnet-stack/include/trendlog.h @@ -32,10 +32,6 @@ #include "rp.h" #include "wp.h" -#ifndef MAX_TREND_LOGS -#define MAX_TREND_LOGS 8 -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/ai.c b/bacnet-stack/ports/bdk-atxx4-mstp/ai.c index 6d721bf8..407b70f1 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/ai.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/ai.c @@ -35,6 +35,10 @@ #include "ai.h" #include "handlers.h" +#ifndef MAX_ANALOG_INPUTS +#define MAX_ANALOG_INPUTS 2 +#endif + static uint8_t Present_Value[MAX_ANALOG_INPUTS]; /* These three arrays are used by the ReadPropertyMultiple handler */ diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/av.c b/bacnet-stack/ports/bdk-atxx4-mstp/av.c index 778ab27f..b75e9bdb 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/av.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/av.c @@ -43,6 +43,10 @@ #include "av.h" #include "handlers.h" +#ifndef MAX_ANALOG_VALUES +#define MAX_ANALOG_VALUES 2 +#endif + static float Present_Value[MAX_ANALOG_VALUES]; /* These three arrays are used by the ReadPropertyMultiple handler */ diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/bi.c b/bacnet-stack/ports/bdk-atxx4-mstp/bi.c index 3d4b0d7a..5cfd555e 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/bi.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/bi.c @@ -35,6 +35,10 @@ #include "bi.h" #include "handlers.h" +#ifndef MAX_BINARY_INPUTS +#define MAX_BINARY_INPUTS 5 +#endif + static BACNET_BINARY_PV Present_Value[MAX_BINARY_INPUTS]; /* These three arrays are used by the ReadPropertyMultiple handler */ diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/bo.c b/bacnet-stack/ports/bdk-atxx4-mstp/bo.c index 703b9a94..7e94fa92 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/bo.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/bo.c @@ -38,6 +38,10 @@ #include "bo.h" #include "handlers.h" +#ifndef MAX_BINARY_OUTPUTS +#define MAX_BINARY_OUTPUTS 2 +#endif + /* When all the priorities are level null, the present value returns */ /* the Relinquish Default value */ #define RELINQUISH_DEFAULT BINARY_INACTIVE diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/main.c b/bacnet-stack/ports/bdk-atxx4-mstp/main.c index 49f1cd96..631a7b33 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/main.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/main.c @@ -138,7 +138,7 @@ static void bacnet_task( /* handle the inputs */ value = adc_result(7); Analog_Input_Present_Value_Set(0, value); - for (i = 0; i < MAX_BINARY_INPUTS; i++) { + for (i = 0; i < 5; i++) { button_value = input_button_value(i); if (button_value) { binary_value = BINARY_ACTIVE;