Added more objects to BDK port, and connected AI to ADC7, and BI0..BI4 to PINB0..PINB4. Fixed up some other objects and object API (header files).
This commit is contained in:
@@ -80,17 +80,13 @@ void Binary_Input_Property_Lists(
|
||||
return;
|
||||
}
|
||||
|
||||
static void Binary_Input_Initialize(
|
||||
void Binary_Input_Init(
|
||||
void)
|
||||
{
|
||||
static bool initialized = false;
|
||||
unsigned i;
|
||||
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
for (i = 0; i < MAX_BINARY_INPUTS; i++) {
|
||||
Present_Value[i] = BINARY_INACTIVE;
|
||||
}
|
||||
for (i = 0; i < MAX_BINARY_INPUTS; i++) {
|
||||
Present_Value[i] = BINARY_INACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,13 +128,12 @@ unsigned Binary_Input_Instance_To_Index(
|
||||
return index;
|
||||
}
|
||||
|
||||
static BACNET_BINARY_PV Binary_Input_Present_Value(
|
||||
BACNET_BINARY_PV Binary_Input_Present_Value(
|
||||
uint32_t object_instance)
|
||||
{
|
||||
BACNET_BINARY_PV value = BINARY_INACTIVE;
|
||||
unsigned index = 0;
|
||||
|
||||
Binary_Input_Initialize();
|
||||
index = Binary_Input_Instance_To_Index(object_instance);
|
||||
if (index < MAX_BINARY_INPUTS) {
|
||||
value = Present_Value[index];
|
||||
@@ -147,6 +142,25 @@ static BACNET_BINARY_PV Binary_Input_Present_Value(
|
||||
return value;
|
||||
}
|
||||
|
||||
bool Binary_Input_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
bool value)
|
||||
{
|
||||
unsigned index = 0;
|
||||
|
||||
index = Binary_Input_Instance_To_Index(object_instance);
|
||||
if (index < MAX_BINARY_INPUTS) {
|
||||
if (value) {
|
||||
Present_Value[index] = BINARY_ACTIVE;
|
||||
} else {
|
||||
Present_Value[index] = BINARY_INACTIVE;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
char *Binary_Input_Name(
|
||||
uint32_t object_instance)
|
||||
{
|
||||
@@ -178,7 +192,6 @@ int Binary_Input_Encode_Property_APDU(
|
||||
|
||||
|
||||
(void) array_index;
|
||||
Binary_Input_Initialize();
|
||||
switch (property) {
|
||||
case PROP_OBJECT_IDENTIFIER:
|
||||
apdu_len =
|
||||
|
||||
Reference in New Issue
Block a user