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; -}