From f9153ffb8a360c95c9e701a273f3c07536963908 Mon Sep 17 00:00:00 2001 From: skarg Date: Thu, 2 Sep 2010 01:44:22 +0000 Subject: [PATCH] Corrected test application writes to Binary Output object. Corrected BACnet task to use Binary Output to control LEDs. --- bacnet-stack/ports/bdk-atxx4-mstp/bacnet.c | 11 +++++++++++ bacnet-stack/ports/bdk-atxx4-mstp/test.c | 12 ++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/bacnet.c b/bacnet-stack/ports/bdk-atxx4-mstp/bacnet.c index 45227aaa..0424b8a1 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/bacnet.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/bacnet.c @@ -32,6 +32,7 @@ #include "rs485.h" #include "input.h" #include "adc.h" +#include "led.h" /* BACnet Stack includes */ #include "datalink.h" #include "npdu.h" @@ -144,6 +145,16 @@ void bacnet_task( } Binary_Input_Present_Value_Set(i, binary_value); } + if (Binary_Output_Present_Value(0) == BINARY_ACTIVE) { + led_on(LED_3); + } else { + led_off(LED_3); + } + if (Binary_Output_Present_Value(1) == BINARY_ACTIVE) { + led_on(LED_4); + } else { + led_off(LED_4); + } /* handle the communication timer */ if (timer_interval_expired(&DCC_Timer)) { timer_interval_reset(&DCC_Timer); diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/test.c b/bacnet-stack/ports/bdk-atxx4-mstp/test.c index b8232dde..d2672e4e 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/test.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/test.c @@ -82,16 +82,16 @@ void test_task( /* echo the character */ serial_byte_send(data_register); if (data_register == '0') { - Binary_Output_Present_Value_Set(0, 0, BINARY_INACTIVE); - Binary_Output_Present_Value_Set(1, 0, BINARY_INACTIVE); + Binary_Output_Present_Value_Set(0, BINARY_INACTIVE, 0); + Binary_Output_Present_Value_Set(1, BINARY_INACTIVE, 0); } if (data_register == '1') { - Binary_Output_Present_Value_Set(0, 0, BINARY_ACTIVE); - Binary_Output_Present_Value_Set(1, 0, BINARY_ACTIVE); + Binary_Output_Present_Value_Set(0, BINARY_ACTIVE, 0); + Binary_Output_Present_Value_Set(1, BINARY_ACTIVE, 0); } if (data_register == '2') { - Binary_Output_Present_Value_Set(0, 0, BINARY_NULL); - Binary_Output_Present_Value_Set(1, 0, BINARY_NULL); + Binary_Output_Present_Value_Set(0, BINARY_NULL, 0); + Binary_Output_Present_Value_Set(1, BINARY_NULL, 0); } serial_byte_send('\r'); serial_byte_send('\n');