Remove checks for mobile node status (on/ off)
This commit is contained in:
parent
e19351ab91
commit
cdaaf8719b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user