From 44b30140b471a69e95ccba4f967ee780ab5aa352 Mon Sep 17 00:00:00 2001 From: skarg Date: Wed, 4 Jun 2014 03:16:34 +0000 Subject: [PATCH] fixed Binary Input values by adding internal pullup to pin. --- bacnet-stack/ports/bdk-atxx4-mstp/input.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/input.c b/bacnet-stack/ports/bdk-atxx4-mstp/input.c index 1fb920c2..5389cabf 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/input.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/input.c @@ -184,11 +184,20 @@ void input_init( BIT_CLEAR(DDRB, DDB1); BIT_CLEAR(DDRB, DDB2); BIT_CLEAR(DDRB, DDB3); + /* activate the internal pull up resistors */ + BIT_SET(PORTB, PORTB1); + BIT_SET(PORTB, PORTB2); + BIT_SET(PORTB, PORTB3); #else BIT_CLEAR(DDRB, DDB1); BIT_CLEAR(DDRB, DDB2); BIT_CLEAR(DDRB, DDB3); BIT_CLEAR(DDRB, DDB4); + /* activate the internal pull up resistors */ + BIT_SET(PORTB, PORTB1); + BIT_SET(PORTB, PORTB2); + BIT_SET(PORTB, PORTB3); + BIT_SET(PORTB, PORTB4); #endif timer_interval_start(&Debounce_Timer, 30); }