Corrected test application writes to Binary Output object. Corrected BACnet task to use Binary Output to control LEDs.
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
#include "rs485.h"
|
#include "rs485.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "adc.h"
|
#include "adc.h"
|
||||||
|
#include "led.h"
|
||||||
/* BACnet Stack includes */
|
/* BACnet Stack includes */
|
||||||
#include "datalink.h"
|
#include "datalink.h"
|
||||||
#include "npdu.h"
|
#include "npdu.h"
|
||||||
@@ -144,6 +145,16 @@ void bacnet_task(
|
|||||||
}
|
}
|
||||||
Binary_Input_Present_Value_Set(i, binary_value);
|
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 */
|
/* handle the communication timer */
|
||||||
if (timer_interval_expired(&DCC_Timer)) {
|
if (timer_interval_expired(&DCC_Timer)) {
|
||||||
timer_interval_reset(&DCC_Timer);
|
timer_interval_reset(&DCC_Timer);
|
||||||
|
|||||||
@@ -82,16 +82,16 @@ void test_task(
|
|||||||
/* echo the character */
|
/* echo the character */
|
||||||
serial_byte_send(data_register);
|
serial_byte_send(data_register);
|
||||||
if (data_register == '0') {
|
if (data_register == '0') {
|
||||||
Binary_Output_Present_Value_Set(0, 0, BINARY_INACTIVE);
|
Binary_Output_Present_Value_Set(0, BINARY_INACTIVE, 0);
|
||||||
Binary_Output_Present_Value_Set(1, 0, BINARY_INACTIVE);
|
Binary_Output_Present_Value_Set(1, BINARY_INACTIVE, 0);
|
||||||
}
|
}
|
||||||
if (data_register == '1') {
|
if (data_register == '1') {
|
||||||
Binary_Output_Present_Value_Set(0, 0, BINARY_ACTIVE);
|
Binary_Output_Present_Value_Set(0, BINARY_ACTIVE, 0);
|
||||||
Binary_Output_Present_Value_Set(1, 0, BINARY_ACTIVE);
|
Binary_Output_Present_Value_Set(1, BINARY_ACTIVE, 0);
|
||||||
}
|
}
|
||||||
if (data_register == '2') {
|
if (data_register == '2') {
|
||||||
Binary_Output_Present_Value_Set(0, 0, BINARY_NULL);
|
Binary_Output_Present_Value_Set(0, BINARY_NULL, 0);
|
||||||
Binary_Output_Present_Value_Set(1, 0, BINARY_NULL);
|
Binary_Output_Present_Value_Set(1, BINARY_NULL, 0);
|
||||||
}
|
}
|
||||||
serial_byte_send('\r');
|
serial_byte_send('\r');
|
||||||
serial_byte_send('\n');
|
serial_byte_send('\n');
|
||||||
|
|||||||
Reference in New Issue
Block a user