Skip to content

Commit

Permalink
Bluefly fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
pascallanger committed Nov 11, 2023
1 parent 5ef9442 commit ffcfd44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions Multiprotocol/Bluefly_ccnrf.ino
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "iface_nrf250k.h"

#define BLUEFLY_PACKET_PERIOD 7000
#define BLUEFLY_PACKET_PERIOD 6000
#define BLUEFLY_PACKET_SIZE 12
#define BLUEFLY_RF_BIND_CHANNEL 81
#define BLUEFLY_NUM_RF_CHANNELS 15
Expand Down Expand Up @@ -49,6 +49,7 @@ static void __attribute__((unused)) BLUEFLY_send_packet()
ch >>= 2;
packet[8 + (i>3?0:1)] = (packet[8 + (i>3?0:1)] >> 2) | ch;
}
// Checksum
uint8_t l, h, t;
l = h = 0xff;
for (uint8_t i=0; i<10; ++i)
Expand All @@ -63,7 +64,6 @@ static void __attribute__((unused)) BLUEFLY_send_packet()
h ^= t & 0xf0;
l ^= ((t<<1) | (t>>7)) & 0xe0;
}
// Checksum
packet[10] = h;
packet[11] = l;
}
Expand All @@ -76,9 +76,9 @@ static void __attribute__((unused)) BLUEFLY_send_packet()
static void __attribute__((unused)) BLUEFLY_RF_init()
{
NRF250K_Init();
NRF250K_SetTXAddr((uint8_t *)"\x32\xAA\x45\x45\x78", 5); // BLUEFLY Bind address
NRF250K_HoppingCalib(BLUEFLY_NUM_RF_CHANNELS); // Calibrate all channels
NRF250K_RFChannel(BLUEFLY_RF_BIND_CHANNEL); // Set bind channel
NRF250K_SetTXAddr((uint8_t *)"\x32\xAA\x45\x45\x78", BLUEFLY_TXID_SIZE); // BLUEFLY Bind address
NRF250K_HoppingCalib(BLUEFLY_NUM_RF_CHANNELS); // Calibrate all channels
NRF250K_RFChannel(BLUEFLY_RF_BIND_CHANNEL); // Set bind channel
}

static void __attribute__((unused)) BLUEFLY_initialize_txid()
Expand All @@ -100,7 +100,7 @@ uint16_t BLUEFLY_callback()
if (bind_counter == 0)
{
BIND_DONE;
NRF250K_SetTXAddr(rx_tx_addr, 5);
NRF250K_SetTXAddr(rx_tx_addr, BLUEFLY_TXID_SIZE);
}
}
BLUEFLY_send_packet();
Expand Down
2 changes: 1 addition & 1 deletion Multiprotocol/Multiprotocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 3
#define VERSION_PATCH_LEVEL 36
#define VERSION_PATCH_LEVEL 37

#define MODE_SERIAL 0

Expand Down

0 comments on commit ffcfd44

Please sign in to comment.