SX1280 parameter modifications

This commit is contained in:
Mark Qvist 2025-01-08 20:58:12 +01:00
parent 58f6a3d6a3
commit 2b93b1b9e7
3 changed files with 8 additions and 14 deletions

View File

@ -88,7 +88,7 @@
#define CSMA_CW_BANDS 4
#define CSMA_CW_MIN 0
#define CSMA_CW_PER_BAND_WINDOWS 15
#define CSMA_BAND_1_MAX_AIRTIME 6
#define CSMA_BAND_1_MAX_AIRTIME 7
#define CSMA_BAND_N_MIN_AIRTIME 85
int csma_slot_ms = CSMA_SLOT_MIN_MS;
long difs_ms = CSMA_SIFS_MS + 2*csma_slot_ms;

View File

@ -558,7 +558,7 @@ void draw_signal_bars(int px, int py) {
}
#if MODEM == SX1280
#define WF_TX_SIZE 3
#define WF_TX_SIZE 5
#else
#define WF_TX_SIZE 5
#endif

View File

@ -107,34 +107,28 @@ bool ISR_VECT sx128x::getPacketValidity() {
void ISR_VECT sx128x::onDio0Rise() {
BaseType_t int_status = taskENTER_CRITICAL_FROM_ISR();
if (sx128x_modem.getPacketValidity()) { sx128x_modem.handleDio0Rise(); }
// On the SX1280, there is a bug which can cause the busy line
// to remain high if a high amount of packets are received when
// in continuous RX mode. This is documented as Errata 16.1 in
// the SX1280 datasheet v3.2 (page 149)
// Therefore, the modem is set into receive mode each time a packet is received.
sx128x_modem.receive();
if (sx128x_modem.getPacketValidity()) { sx128x_modem.receive(); sx128x_modem.handleDio0Rise(); }
else { sx128x_modem.receive(); }
taskEXIT_CRITICAL_FROM_ISR(int_status);
}
void sx128x::handleDio0Rise() {
// received a packet
_packetIndex = 0;
uint8_t rxbuf[2] = {0};
executeOpcodeRead(OP_RX_BUFFER_STATUS_8X, rxbuf, 2);
// If implicit header mode is enabled, read packet length as payload length instead.
// See SX1280 datasheet v3.2, page 92
if (_implicitHeaderMode == 0x80) {
_rxPacketLength = _payloadLength;
} else {
_rxPacketLength = rxbuf[0];
}
if (_implicitHeaderMode == 0x80) { _rxPacketLength = _payloadLength; }
else { _rxPacketLength = rxbuf[0]; }
if (_onReceive) {
_onReceive(_rxPacketLength);
}
if (_onReceive) { _onReceive(_rxPacketLength); }
}
bool sx128x::preInit() {