mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2025-05-04 07:34:49 -04:00
SX1280 parameter modifications
This commit is contained in:
parent
58f6a3d6a3
commit
2b93b1b9e7
3 changed files with 8 additions and 14 deletions
2
Config.h
2
Config.h
|
@ -88,7 +88,7 @@
|
||||||
#define CSMA_CW_BANDS 4
|
#define CSMA_CW_BANDS 4
|
||||||
#define CSMA_CW_MIN 0
|
#define CSMA_CW_MIN 0
|
||||||
#define CSMA_CW_PER_BAND_WINDOWS 15
|
#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
|
#define CSMA_BAND_N_MIN_AIRTIME 85
|
||||||
int csma_slot_ms = CSMA_SLOT_MIN_MS;
|
int csma_slot_ms = CSMA_SLOT_MIN_MS;
|
||||||
long difs_ms = CSMA_SIFS_MS + 2*csma_slot_ms;
|
long difs_ms = CSMA_SIFS_MS + 2*csma_slot_ms;
|
||||||
|
|
|
@ -558,7 +558,7 @@ void draw_signal_bars(int px, int py) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MODEM == SX1280
|
#if MODEM == SX1280
|
||||||
#define WF_TX_SIZE 3
|
#define WF_TX_SIZE 5
|
||||||
#else
|
#else
|
||||||
#define WF_TX_SIZE 5
|
#define WF_TX_SIZE 5
|
||||||
#endif
|
#endif
|
||||||
|
|
18
sx128x.cpp
18
sx128x.cpp
|
@ -107,34 +107,28 @@ bool ISR_VECT sx128x::getPacketValidity() {
|
||||||
|
|
||||||
void ISR_VECT sx128x::onDio0Rise() {
|
void ISR_VECT sx128x::onDio0Rise() {
|
||||||
BaseType_t int_status = taskENTER_CRITICAL_FROM_ISR();
|
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
|
// 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
|
// to remain high if a high amount of packets are received when
|
||||||
// in continuous RX mode. This is documented as Errata 16.1 in
|
// in continuous RX mode. This is documented as Errata 16.1 in
|
||||||
// the SX1280 datasheet v3.2 (page 149)
|
// the SX1280 datasheet v3.2 (page 149)
|
||||||
// Therefore, the modem is set into receive mode each time a packet is received.
|
// 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);
|
taskEXIT_CRITICAL_FROM_ISR(int_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sx128x::handleDio0Rise() {
|
void sx128x::handleDio0Rise() {
|
||||||
// received a packet
|
|
||||||
_packetIndex = 0;
|
_packetIndex = 0;
|
||||||
|
|
||||||
uint8_t rxbuf[2] = {0};
|
uint8_t rxbuf[2] = {0};
|
||||||
executeOpcodeRead(OP_RX_BUFFER_STATUS_8X, rxbuf, 2);
|
executeOpcodeRead(OP_RX_BUFFER_STATUS_8X, rxbuf, 2);
|
||||||
|
|
||||||
// If implicit header mode is enabled, read packet length as payload length instead.
|
// If implicit header mode is enabled, read packet length as payload length instead.
|
||||||
// See SX1280 datasheet v3.2, page 92
|
// See SX1280 datasheet v3.2, page 92
|
||||||
if (_implicitHeaderMode == 0x80) {
|
if (_implicitHeaderMode == 0x80) { _rxPacketLength = _payloadLength; }
|
||||||
_rxPacketLength = _payloadLength;
|
else { _rxPacketLength = rxbuf[0]; }
|
||||||
} else {
|
|
||||||
_rxPacketLength = rxbuf[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_onReceive) {
|
if (_onReceive) { _onReceive(_rxPacketLength); }
|
||||||
_onReceive(_rxPacketLength);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sx128x::preInit() {
|
bool sx128x::preInit() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue