diff --git a/avrrfm.c b/avrrfm.c index 288de65..0dea999 100644 --- a/avrrfm.c +++ b/avrrfm.c @@ -48,6 +48,7 @@ #define NODE0 0x12 #define NODE1 0x24 #define NODE2 0x42 +#define BCAST 0x84 /* Carrier frequency in kHz */ #define FREQ 868600 @@ -341,7 +342,7 @@ printString("Hello Radio!\r\n"); uint8_t node = RECEIVER ? NODE1 : NODE2; - bool radio = rfmInit(FREQ, node, LORA); + bool radio = rfmInit(FREQ, node, BCAST, LORA); if (!radio) { printString("Radio init failed!\r\n"); } @@ -361,10 +362,6 @@ } while (true) { - // do something else besides tx/rx - // printString("Running...\r\n"); - // _delay_ms(1000); - if (radio) { if (!RECEIVER) { if (watchdogInts % measureInts == 0) { diff --git a/librfm95.a b/librfm95.a index 533d477..17fc972 100644 --- a/librfm95.a +++ b/librfm95.a Binary files differ diff --git a/librfm95.h b/librfm95.h index 07708ba..4032bf1 100644 --- a/librfm95.h +++ b/librfm95.h @@ -108,7 +108,6 @@ #define RFM_MASK_MODE 0x07 #define RFM_F_STEP 61035 -#define RFM_CAST_ADDRESS 0x84 #define RFM_DBM_MIN 2 #define RFM_DBM_MAX 17 @@ -168,12 +167,16 @@ /** * Initializes the radio module in FSK or LoRa mode with the given carrier - * frequency in kilohertz and node address. Returns true on success, - * false otherwise. + * frequency in kilohertz and node and brodcast address. + * Returns true on success, false otherwise. * + * @param freq carrier frequency + * @param node address + * @param broadcast address + * @param lora LoRa or FSK mode * @return success */ -bool rfmInit(uint64_t freq, uint8_t node, bool lora); +bool rfmInit(uint64_t freq, uint8_t node, uint8_t cast, bool lora); /** * Reads interrupt flags. Should be called when any interrupt occurs