Porównaj commity

...

5 Commity

Autor SHA1 Wiadomość Data
sh123 72c7a536c7
Update config.h 2022-12-20 16:45:59 +02:00
sh123 3375aa1270 Increase version 2022-12-20 13:17:11 +02:00
sh123 ca926369f9 Fix naming 2022-12-20 13:06:32 +02:00
sh123 2515924479 Minor improvements 2022-12-20 11:02:31 +02:00
sh123 6dc667be62 Split operation fixes 2022-12-20 10:57:29 +02:00
3 zmienionych plików z 15 dodań i 12 usunięć

Wyświetl plik

@ -38,7 +38,9 @@
#define CFG_LORA_PIN_RXEN 32 // (sx127x - unused, sx126x - RXEN pin number)
#define CFG_LORA_PIN_TXEN 33 // (sx127x - unused, sx126x - TXEN pin number)
#else
#define CFG_LORA_PIN_B RADIOLIB_NC // (sx127x - dio1, sx126x/sx128x - busy)
#define CFG_LORA_PIN_B RADIOLIB_NC
#define CFG_LORA_PIN_RXEN RADIOLIB_NC
#define CFG_LORA_PIN_TXEN RADIOLIB_NC
#endif
// Redefine LED if not defined in Arduino to have module heartbeat indication

Wyświetl plik

@ -119,7 +119,7 @@ private:
} __attribute__((packed));
private:
const String CfgLoraprsVersion = "LoRAPRS 1.0.7";
const String CfgLoraprsVersion = "LoRAPRS 1.0.9";
// processor config
const int CfgConnRetryMs = 500; // connection retry delay, e.g. wifi

Wyświetl plik

@ -243,8 +243,8 @@ void Service::setupRig(long loraFreq, long bw, int sf, int cr, int pwr, int sync
#else
#pragma message("Using SX127X")
LOG_INFO("Using SX127X module");
if (isIsrInstalled_) radio_->clearDio0Action();
radio_->setDio0Action(onRigIsrRxPacket);
if (isIsrInstalled_) rig_->clearDio0Action();
rig_->setDio0Action(onRigIsrRxPacket);
isIsrInstalled_ = true;
#endif
@ -326,8 +326,7 @@ ICACHE_RAM_ATTR void Service::onRigIsrRxPacket() {
BaseType_t xHigherPriorityTaskWoken;
if (rigIsRxIsrEnabled_) {
rigIsRxActive_ = true;
uint32_t radioReceiveBit = RadioTaskBits::Receive;
xTaskNotifyFromISR(rigTaskHandle_, radioReceiveBit, eSetBits, &xHigherPriorityTaskWoken);
xTaskNotifyFromISR(rigTaskHandle_, RadioTaskBits::Receive, eSetBits, &xHigherPriorityTaskWoken);
}
}
@ -337,10 +336,10 @@ void Service::rigTask(void *self) {
uint32_t commandBits = 0;
xTaskNotifyWaitIndexed(0, 0x00, ULONG_MAX, &commandBits, portMAX_DELAY);
if (commandBits & RadioTaskBits::Receive) {
((Service*)self)->onRigTaskRxPacket();
static_cast<Service*>(self)->onRigTaskRxPacket();
}
else if (commandBits & RadioTaskBits::Transmit) {
((Service*)self)->onRigTaskTxPacket();
static_cast<Service*>(self)->onRigTaskTxPacket();
}
}
}
@ -471,7 +470,7 @@ void Service::sendSignalReportEvent(int rssi, float snr)
bool Service::sendModemTelemetryTimer(void *param)
{
((Service *)param)->sendModemTelemetry();
static_cast<Service*>(param)->sendModemTelemetry();
return true;
}
@ -526,7 +525,7 @@ void Service::performFrequencyCorrection() {
#ifdef USE_SX126X
long frequencyErrorHz = 0;
#else
long frequencyErrorHz = radio_->getFrequencyError();
long frequencyErrorHz = rig_->getFrequencyError();
#endif
if (abs(frequencyErrorHz) > config_.AutoFreqCorrectionDeltaHz) {
config_.LoraFreqRx -= frequencyErrorHz;
@ -536,7 +535,7 @@ void Service::performFrequencyCorrection() {
}
void Service::setFreq(long loraFreq) const {
rig_->setFrequency((float)config_.LoraFreqRx / 1e6);
rig_->setFrequency((float)loraFreq / 1e6);
int state = rig_->startReceive();
if (state != RADIOLIB_ERR_NONE) {
LOG_ERROR("Start receive error:", state);
@ -563,7 +562,7 @@ void Service::processIncomingRawPacketAsServer(const byte *packet, int packetLen
#ifdef USE_SX126X
long frequencyError = 0;
#else
long frequencyError = radio_->getFrequencyError();
long frequencyError = rig_->getFrequencyError();
#endif
String signalReport = String("rssi: ") +
String(snr < 0 ? rssi + snr : rssi) +
@ -736,7 +735,9 @@ void Service::onRadioControlCommand(const std::vector<byte> &rawCommand) {
LOG_INFO("Setting new radio parameters");
const struct SetHardware * setHardware = reinterpret_cast<const struct SetHardware*>(rawCommand.data());
// TODO, add support for split set hardware
config_.LoraFreqRx = be32toh(setHardware->freq);
config_.LoraFreqTx = be32toh(setHardware->freq);
config_.LoraBw = be32toh(setHardware->bw);
config_.LoraSf = be16toh(setHardware->sf);
config_.LoraCodingRate = be16toh(setHardware->cr);