Remove checks for mobile node status (on/ off)

This commit is contained in:
Rihards Skuja 2018-01-22 21:21:47 +02:00
parent e19351ab91
commit cdaaf8719b
No known key found for this signature in database
GPG Key ID: 53FA13A3F7F8571B

View File

@ -11,8 +11,6 @@
#include "debug.h" #include "debug.h"
#endif /* DEBUG */ #endif /* DEBUG */
volatile uint8_t conn_lost;
int main(void) int main(void)
{ {
uint8_t *rx_raw; uint8_t *rx_raw;
@ -50,7 +48,7 @@ int main(void)
nrf24_getData(rx_raw); nrf24_getData(rx_raw);
memcpy(rx_data, rx_raw, sizeof(data_packet_t)); 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); SET(LED_PORT, LED_BLUE_BIT);
else else
CLR(LED_PORT, LED_BLUE_BIT); CLR(LED_PORT, LED_BLUE_BIT);
@ -59,8 +57,6 @@ int main(void)
SET(LED_PORT, LED_GREEN_BIT); SET(LED_PORT, LED_GREEN_BIT);
else else
CLR(LED_PORT, LED_GREEN_BIT); CLR(LED_PORT, LED_GREEN_BIT);
conn_lost = 0;
} }
} }
@ -71,14 +67,3 @@ int main(void)
return 0; 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;
}