mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2026-12-06 07:37:38 +00:00
T-FHSS Surface: RX off before the receiver listens again (#1220)
The reply was read just before the next TX packet, so the CC2500 sat in RX on the next channel from 1.0 ms to 3.0 ms. The R334SBS turns its own RX back on there ~2.6 ms after the TX packet; with the TX ~60 kHz off (MT12, #507) the link then broke (3 % replies), fine with the RX phase skipped or the frequency tuned. The reply is now read, and the RX turned off, 2.75 ms after the TX callback (TFHSS_RX_READ, ~170 us after the reply's end, ~200 us before the receiver's RX). Also removes the ~80 us late TX packet after each reply. Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
This commit is contained in:
1 parent
0972f356aa
commit
88d807870d
1 file changed
+15
-8
@@ -69,9 +69,14 @@
|
||||
#define TFHSS_PERIOD 3000
|
||||
#define TFHSS_SR_PERIOD 1200
|
||||
#define TFHSS_RX_ON 1000 // from the TX packet's start: RX on the next channel
|
||||
// The reply (1.9 ms after the TX packet's start, 0.4 ms long) is read in the
|
||||
// next frame's callback, before its TX packet: the TX packet goes on air 0.4 ms
|
||||
// after the callback on the MPM v2, a read 2.5 ms after the callback missed it
|
||||
// The reply (its sync word 1.9 ms after the TX packet's, 14 bytes = 0.3 ms) is
|
||||
// read, and the RX turned off, TFHSS_RX_READ after the callback that sent the
|
||||
// TX packet: well before the receiver turns its own RX back on there (~2.6 ms
|
||||
// after the TX packet, R334SBS), where a CC2500 left in RX until our next
|
||||
// packet broke the link once the TX was ~60 kHz off (MT12, MPM #507)
|
||||
#ifndef TFHSS_RX_READ
|
||||
#define TFHSS_RX_READ 2750 // STM32: the TX packet on air ~0.1 ms after the callback
|
||||
#endif
|
||||
#define TFHSS_LEN 14
|
||||
#define TFHSS_FS_EVERY 1667 // frames, 5 s
|
||||
#define TFHSS_SR_FS_EVERY 4167
|
||||
@@ -127,7 +132,7 @@ static bool TFHSS_rx_known;
|
||||
static uint8_t TFHSS_misses;
|
||||
static uint8_t TFHSS_row;
|
||||
static bool TFHSS_list_mode; // bind (link): hopping on the list
|
||||
static bool TFHSS_rx_pending; // Surface: RX on for a reply, read at the next frame
|
||||
static bool TFHSS_rx_pending; // Surface: RX on for a reply, read at TFHSS_RX_READ
|
||||
static uint8_t TFHSS_ch; // the channel of the next TX packet
|
||||
static uint16_t TFHSS_frame;
|
||||
static uint16_t TFHSS_link; // link frames left (after the reply) or sent
|
||||
@@ -602,13 +607,10 @@ static uint16_t __attribute__((unused)) TFHSS_callback()
|
||||
TFHSS_surface_read(true);
|
||||
return TFHSS_PERIOD;
|
||||
}
|
||||
// The packet built first, then the reply read (on this frame's
|
||||
// channel), as late as possible, then the packet sent
|
||||
if(TFHSS_list_mode)
|
||||
TFHSS_surface_bind_packet();
|
||||
else
|
||||
TFHSS_surface_packet();
|
||||
TFHSS_surface_read(TFHSS_list_mode);
|
||||
CC2500_SetFreqOffset();
|
||||
TFHSS_SetPower();
|
||||
TFHSS_tune(TFHSS_ch);
|
||||
@@ -627,8 +629,13 @@ static uint16_t __attribute__((unused)) TFHSS_callback()
|
||||
case TFHSS_RX:
|
||||
TFHSS_rx_on(TFHSS_LEN);
|
||||
TFHSS_rx_pending = true;
|
||||
phase = TFHSS_READ;
|
||||
return TFHSS_RX_READ - TFHSS_RX_ON;
|
||||
case TFHSS_READ:
|
||||
// The reply (on the channel of the next TX packet), RX off
|
||||
TFHSS_surface_read(TFHSS_list_mode);
|
||||
phase = TFHSS_DATA;
|
||||
return TFHSS_PERIOD - TFHSS_RX_ON;
|
||||
return TFHSS_PERIOD - TFHSS_RX_READ;
|
||||
}
|
||||
return TFHSS_PERIOD;
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user