From cdaaf8719b7bb923632e29c494ae578da20b4ee0 Mon Sep 17 00:00:00 2001 From: Rihards Skuja Date: Mon, 22 Jan 2018 21:21:47 +0200 Subject: [PATCH] Remove checks for mobile node status (on/ off) --- base_station/src/main.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/base_station/src/main.c b/base_station/src/main.c index 6da3528..b61debb 100644 --- a/base_station/src/main.c +++ b/base_station/src/main.c @@ -11,8 +11,6 @@ #include "debug.h" #endif /* DEBUG */ -volatile uint8_t conn_lost; - int main(void) { uint8_t *rx_raw; @@ -50,7 +48,7 @@ int main(void) nrf24_getData(rx_raw); memcpy(rx_data, rx_raw, sizeof(data_packet_t)); - if (rx_data->distance < 10) + if (rx_data->distance < 10 && rx_data->distance >= 0) SET(LED_PORT, LED_BLUE_BIT); else CLR(LED_PORT, LED_BLUE_BIT); @@ -59,8 +57,6 @@ int main(void) SET(LED_PORT, LED_GREEN_BIT); else CLR(LED_PORT, LED_GREEN_BIT); - - conn_lost = 0; } } @@ -71,14 +67,3 @@ int main(void) return 0; } - -ISR(TIMER1_OVF_vect) -{ - // Node hasn't responded for a while, turn off all signal LEDs - if (conn_lost == 1) { - CLR(LED_PORT, LED_GREEN_BIT); - CLR(LED_PORT, LED_BLUE_BIT); - } - - conn_lost = 1; -}