some config options ++

This commit is contained in:
Hansi, dl9rdz 2019-05-06 17:25:54 +02:00
parent 3549ab21cf
commit fdeb179a67
3 changed files with 14 additions and 1 deletions

View File

@ -330,6 +330,7 @@ uint8_t SX1278FSK::setFrequency(float freq) {
// set mode to FSK STANDBY // set mode to FSK STANDBY
writeRegister(REG_OP_MODE, FSK_STANDBY_MODE); writeRegister(REG_OP_MODE, FSK_STANDBY_MODE);
freq += sonde.config.freqofs; // manual frequency correction
uint32_t frf = freq * 1.0 * (1<<19) / SX127X_CRYSTAL_FREQ; uint32_t frf = freq * 1.0 * (1<<19) / SX127X_CRYSTAL_FREQ;
writeRegister(REG_FRF_MSB, (frf&0xff0000)>>16); writeRegister(REG_FRF_MSB, (frf&0xff0000)>>16);

View File

@ -4,8 +4,10 @@
#include "Sonde.h" #include "Sonde.h"
#include "RS41.h" #include "RS41.h"
#include "DFM.h" #include "DFM.h"
#include "SX1278FSK.h"
extern U8X8_SSD1306_128X64_NONAME_SW_I2C *u8x8; extern U8X8_SSD1306_128X64_NONAME_SW_I2C *u8x8;
extern SX1278FSK sx1278;
//SondeInfo si = { STYPE_RS41, 403.450, "P1234567", true, 48.1234, 14.9876, 543, 3.97, -0.5, true, 120 }; //SondeInfo si = { STYPE_RS41, 403.450, "P1234567", true, 48.1234, 14.9876, 543, 3.97, -0.5, true, 120 };
const char *sondeTypeStr[5] = { "DFM6", "DFM9", "RS41" }; const char *sondeTypeStr[5] = { "DFM6", "DFM9", "RS41" };
@ -75,6 +77,8 @@ Sonde::Sonde() {
config.timer=0; config.timer=0;
config.marker=0; config.marker=0;
config.norx_timeout=0; config.norx_timeout=0;
config.showafc=0;
config.freqofs=0;
config.rs41.agcbw=25; config.rs41.agcbw=25;
config.rs41.rxbw=12; config.rs41.rxbw=12;
config.udpfeed.active = 1; config.udpfeed.active = 1;
@ -142,6 +146,8 @@ void Sonde::setConfig(const char *cfg) {
config.norx_timeout = atoi(val); config.norx_timeout = atoi(val);
} else if(strcmp(cfg,"showafc")==0) { } else if(strcmp(cfg,"showafc")==0) {
config.showafc = atoi(val); config.showafc = atoi(val);
} else if(strcmp(cfg,"freqofs")==0) {
config.freqofs = atoi(val);
} else if(strcmp(cfg,"rs41.agcbw")==0) { } else if(strcmp(cfg,"rs41.agcbw")==0) {
config.rs41.agcbw = atoi(val); config.rs41.agcbw = atoi(val);
} else if(strcmp(cfg,"rs41.rxbw")==0) { } else if(strcmp(cfg,"rs41.rxbw")==0) {
@ -246,6 +252,11 @@ void Sonde::setup() {
dfm.setFrequency(sondeList[currentSonde].freq * 1000000); dfm.setFrequency(sondeList[currentSonde].freq * 1000000);
break; break;
} }
// debug
float afcbw = sx1278.getAFCBandwidth();
float rxbw = sx1278.getRxBandwidth();
Serial.printf("AFC BW: %f RX BW: %f\n", afcbw, rxbw);
} }
int Sonde::receiveFrame() { int Sonde::receiveFrame() {
int ret; int ret;

View File

@ -35,6 +35,7 @@ typedef struct st_rdzconfig {
int norx_timeout; // Time after which rx mode switches to scan mode (without rx signal) int norx_timeout; // Time after which rx mode switches to scan mode (without rx signal)
int noisefloor; // for spectrum display int noisefloor; // for spectrum display
int showafc; // show afc value in rx screen int showafc; // show afc value in rx screen
int freqofs; // frequency offset (tuner config = rx frequency + freqofs) in Hz
char call[9]; // APRS callsign char call[9]; // APRS callsign
char passcode[9]; // APRS passcode char passcode[9]; // APRS passcode
struct st_rs41config rs41; // configuration options specific for RS41 receiver struct st_rs41config rs41; // configuration options specific for RS41 receiver