diff --git a/plugin_setup.php b/plugin_setup.php index e9a1d89..df09bab 100755 --- a/plugin_setup.php +++ b/plugin_setup.php @@ -67,7 +67,7 @@ function OnConnectionChanged() {

Power (88-115, 116-120*): dBμV
*Can be set as high as 120dBμV, but voltage accuracy above 115dBμV is not guaranteed.

Preemphasis: "50us", "75μs (USA, default)"=>"75us"), "fpp-vastfmt", ""); ?>

-

Antenna Tuning Capacitor (0=Auto, 1-191): * 0.25pF

+

Antenna Tuning Capacitor (0=Auto, 1-191): * 0.25pF (If set to 0 and no FM signal detected, try a value around 50-80)

Enable Audio Limitter:

Enable Audio Compression:

Audio Compression Threshold (-64 - 0 db):

diff --git a/src/FPPVastFM.cpp b/src/FPPVastFM.cpp index 77068ca..05a51ec 100755 --- a/src/FPPVastFM.cpp +++ b/src/FPPVastFM.cpp @@ -71,7 +71,10 @@ class FPPVastFMPlugin : public FPPPlugin { si4713->enableAudioLimitter(settings["AudioLimitter"] == "True"); si4713->setAudioGain(std::stoi(settings["AudioGain"])); si4713->setAudioCompressionThreshold(std::stoi(settings["AudioCompressionThreshold"])); - + if (settings["Preemphasis"] == "50us") { + si4713->setEUPreemphasis(); + } + si4713->Init(); std::string rev = si4713->getRev(); @@ -96,18 +99,14 @@ class FPPVastFMPlugin : public FPPPlugin { void startVast() { if (si4713 == nullptr) { if (initVast()) { - if (settings["Preemphasis"] == "50us") { - si4713->setEUPreemphasis(); - } - - float f = std::stoi(settings["AntCap"]); - si4713->setTXPower(std::stoi(settings["Power"]), f); - std::string freq = settings["Frequency"]; - f = std::stof(freq); + float f = std::stof(freq); f *= 100; - si4713->setFrequency(f); + + f = std::stoi(settings["AntCap"]); + si4713->setTXPower(std::stoi(settings["Power"]), f); + si4713->setPTY(std::stoi(settings["Pty"])); std::string asq = si4713->getASQ(); diff --git a/src/I2CSi4713.cpp b/src/I2CSi4713.cpp index f5379ae..d6ab34b 100755 --- a/src/I2CSi4713.cpp +++ b/src/I2CSi4713.cpp @@ -58,11 +58,10 @@ I2CSi4713::I2CSi4713(const std::string &gpioPin) { } } I2CSi4713::~I2CSi4713() { - if (i2c) { + //sendSi4711Command(SI4710_CMD_POWER_DOWN, {}); delete i2c; } - } diff --git a/src/Si4713.cpp b/src/Si4713.cpp index df53c02..fd71969 100755 --- a/src/Si4713.cpp +++ b/src/Si4713.cpp @@ -113,7 +113,10 @@ void Si4713::setFrequency(int frequency) { sendSi4711Command(TX_TUNE_FREQ, {0x00, ft, fl}); } void Si4713::setTXPower(int power, double antCap) { - uint8_t rfcap0 = antCap/0.25; + uint8_t rfcap0 = antCap; + if (rfcap0 > 191) { + rfcap0 = 191; + } uint8_t p = power & 0xff; sendSi4711Command(TX_TUNE_POWER, {0x00, 0x00, p, rfcap0}); }