diff --git a/base_station/Makefile b/base_station/Makefile index 2f76c4b..af936c4 100644 --- a/base_station/Makefile +++ b/base_station/Makefile @@ -31,7 +31,7 @@ CDEFS = -DF_CPU=16000000L -D__AVR__ -D__AVR_ATmega328P__ # Place -I options here CINCS = -I /usr/avr/include -I /usr/lib/gcc/avr/7.2.0/include \ - -I $(INC_DIR) -I $(COMMON_INC_DIR) + -I $(COMMON_INC_DIR) -I $(INC_DIR) CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums #CEXTRA = -Wa,-adhlns=$(<:.c=.lst) diff --git a/base_station/include/main.h b/base_station/include/main.h index 373d0d6..e5d6651 100644 --- a/base_station/include/main.h +++ b/base_station/include/main.h @@ -4,9 +4,6 @@ #include #include "common.h" -uint8_t tx_address[5] = {0xD7, 0xD7, 0xD7, 0xD7, 0xD7}; -uint8_t rx_address[5] = {0xE7, 0xE7, 0xE7, 0xE7, 0xE7}; - void convert_raw_to_data(uint8_t *in, data_packet_t *out); #endif diff --git a/base_station/src/main.c b/base_station/src/main.c index 181a95e..c23ada6 100644 --- a/base_station/src/main.c +++ b/base_station/src/main.c @@ -26,8 +26,8 @@ int main(void) nrf24_init(); nrf24_config(2, sizeof(data_packet_t)); // Channel #2 - nrf24_rx_address(rx_address); - nrf24_rx_address(rx_address); + nrf24_tx_address(node_mac); + nrf24_rx_address(base_mac); // Use green LED as power LED // TODO: need all LEDs for debugging, will use as power when UART debugger @@ -49,6 +49,9 @@ int main(void) SET(LED_PORT, LED_GREEN_BIT); else CLR(LED_PORT, LED_GREEN_BIT); + } else { + CLR(LED_PORT, LED_GREEN_BIT); + CLR(LED_PORT, LED_BLUE_BIT); } } diff --git a/common/include/common.h b/common/include/common.h index 65677ab..12c5127 100644 --- a/common/include/common.h +++ b/common/include/common.h @@ -23,4 +23,9 @@ typedef struct { uint16_t distance; } data_packet_t; +// Base station radio MAC address +static uint8_t base_mac[5] = {0xE7, 0xE7, 0xE7, 0xE7, 0xE7}; +// Mobile node radio MAC address +static uint8_t node_mac[5] = {0xD7, 0xD7, 0xD7, 0xD7, 0xD7}; + #endif /* COMMON_H */ diff --git a/robot/Makefile b/robot/Makefile index 2f76c4b..af936c4 100644 --- a/robot/Makefile +++ b/robot/Makefile @@ -31,7 +31,7 @@ CDEFS = -DF_CPU=16000000L -D__AVR__ -D__AVR_ATmega328P__ # Place -I options here CINCS = -I /usr/avr/include -I /usr/lib/gcc/avr/7.2.0/include \ - -I $(INC_DIR) -I $(COMMON_INC_DIR) + -I $(COMMON_INC_DIR) -I $(INC_DIR) CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums #CEXTRA = -Wa,-adhlns=$(<:.c=.lst) diff --git a/robot/include/main.h b/robot/include/main.h index ed7cd36..b5fa035 100644 --- a/robot/include/main.h +++ b/robot/include/main.h @@ -4,9 +4,6 @@ #include #include "common.h" -uint8_t tx_address[5] = {0xE7, 0xE7, 0xE7, 0xE7, 0xE7}; -uint8_t rx_address[5] = {0xD7, 0xD7, 0xD7, 0xD7, 0xD7}; - void convert_data_to_raw(data_packet_t *in, uint8_t *out); #endif diff --git a/robot/src/main.c b/robot/src/main.c index 86cf8e6..e265e44 100644 --- a/robot/src/main.c +++ b/robot/src/main.c @@ -31,8 +31,8 @@ int main(void) nrf24_init(); nrf24_config(2, sizeof(data_packet_t)); // Channel #2 - nrf24_tx_address(tx_address); - nrf24_rx_address(rx_address); + nrf24_tx_address(base_mac); + nrf24_rx_address(node_mac); // Use green LED as power LED // TODO: need all LEDs for debugging, will use as power when UART debugger