Fixed TG CS pin define compile error
Corrected problem with CS pins floating if module installed but not initialised. Also corrected compiler error if neither TG SI4432 defined
This commit is contained in:
parent
1e34a6ae95
commit
1746058f31
@ -25,11 +25,11 @@ void initIF_Sweep()
|
||||
setting.Mode = tinySA_mode;
|
||||
|
||||
// Turn off track gen
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
tg_if.RxMode();
|
||||
#endif
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
tg_lo.RxMode();
|
||||
#endif
|
||||
|
||||
|
@ -27,11 +27,11 @@ void initRX_Sweep()
|
||||
setting.Mode = tinySA_mode;
|
||||
|
||||
// Turn off track gen
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
tg_if.RxMode();
|
||||
#endif
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
tg_lo.RxMode();
|
||||
#endif
|
||||
|
||||
|
@ -26,13 +26,13 @@ void initSigLow()
|
||||
xmit.SetOffset ( 0 ); // make sure frequency offset registers are zero
|
||||
rcvr.SetOffset ( 0 );
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
if (tgIF_OK) {
|
||||
tg_if.RxMode ( ); // turn off the IF oscillator in tracking generator
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
if (tgLO_OK) {
|
||||
tg_lo.RxMode ( ); // turn off the Local Oscillator in tracking generator
|
||||
}
|
||||
|
14
SweepLo.ino
14
SweepLo.ino
@ -168,21 +168,21 @@ static uint32_t tgIF; // Track gen IF - SA IF plus any offset if both SI4432
|
||||
pushSettings ();
|
||||
#endif // #ifdef USE_WIFI
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
if (tgIF_OK && (trackGenSetting.Mode == 1) )
|
||||
tg_if.TxMode ( trackGenSetting.IF_Drive ); // Set tracking generator IF on
|
||||
else
|
||||
tg_if.RxMode();
|
||||
#endif
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
if (tgLO_OK && (trackGenSetting.Mode == 1) )
|
||||
tg_lo.TxMode ( trackGenSetting.LO_Drive ); // Set tracking generator LO on
|
||||
else
|
||||
tg_lo.RxMode();
|
||||
#endif
|
||||
|
||||
#if defined(SI_TG_IF_CS) && defined(SI_TG_LO_CS)
|
||||
#if defined(TG_IF_INSTALLED) && defined(TG_LO_INSTALLED)
|
||||
if (tgLO_OK && tgIF_OK && (trackGenSetting.Mode == 2) ) // tracking gen as signal generator
|
||||
{
|
||||
tg_if.SetFrequency ( setting.IF_Freq + trackGenSetting.Offset );
|
||||
@ -240,7 +240,7 @@ static uint32_t tgIF; // Track gen IF - SA IF plus any offset if both SI4432
|
||||
lastIF = tempIF;
|
||||
actualIF = rcvr.GetFrequency();
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
if (tgIF_OK && (trackGenSetting.Mode == 1) )
|
||||
tg_if.SetFrequency ( tgIF ); // Set tracking generator IF for the sweep
|
||||
#endif
|
||||
@ -248,7 +248,7 @@ static uint32_t tgIF; // Track gen IF - SA IF plus any offset if both SI4432
|
||||
|
||||
xmit.SetFrequency ( tempIF + autoSweepFreq ); // set the LO frequency, tempIF is offset if spur reduction on
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
if (tgLO_OK && (trackGenSetting.Mode == 1) )
|
||||
tg_lo.SetFrequency ( tgIF + autoSweepFreq ); // Set tracking generator LO
|
||||
#endif
|
||||
@ -405,7 +405,7 @@ static uint32_t tgIF; // Track gen IF - SA IF plus any offset if both SI4432
|
||||
xmit.SetFrequency ( f ); // Set the new LO frequency as soon as RSSI read
|
||||
// Serial.printf("LO Required: %i Actual %i\n", tempIF+autoSweepFreq, xmit.GetFrequency());
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
if (tgLO_OK && (trackGenSetting.Mode == 1) )
|
||||
{
|
||||
tg_lo.SetFrequency ( f + trackGenSetting.Offset ); // Set tracking generator LO
|
||||
@ -414,7 +414,7 @@ static uint32_t tgIF; // Track gen IF - SA IF plus any offset if both SI4432
|
||||
|
||||
setFreqMicros = micros(); // Store the time the LO frequency was changed
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
// if (trackGenSetting.Mode == 1)
|
||||
// Serial.printf("tglo %i @ %i\n", tg_lo.GetFrequency(), setFreqMicros);
|
||||
#endif
|
||||
|
56
cmd.cpp
56
cmd.cpp
@ -28,10 +28,10 @@
|
||||
extern PE4302 att; // PE4302 Attenuator object
|
||||
extern Si4432 rcvr; // Si4432 Receiver object
|
||||
extern Si4432 xmit; // Si4432 Transmitter object
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
extern Si4432 tg_if; // Si4432 Transmitter object
|
||||
#endif
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
extern Si4432 tg_lo; // Si4432 Transmitter object
|
||||
#endif
|
||||
|
||||
@ -276,23 +276,23 @@ void ShowMenu ()
|
||||
Serial.print ( "]; currently: " );
|
||||
Serial.println ( sigGenSetting.RX_Drive );
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
Serial.println ( "\nTracking Generator Commands:\n" );
|
||||
|
||||
Serial.println ( " TRACKON.......Turn on tracking generator output" );
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
Serial.println ( " TRACKSIG......Turn on tracking generator signal generator output" );
|
||||
#endif
|
||||
Serial.print ( " TRACKOFF......Turn off tracking generator output; currently " );
|
||||
Serial.println ( trackGenSetting.Mode );
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
Serial.print ( " TGLODRIVE.....Local oscillator drive level in tracking generator mode [0 to 7]; currently: " );
|
||||
Serial.println ( trackGenSetting.LO_Drive );
|
||||
#endif
|
||||
Serial.print ( " TGIFDRIVE.....Local oscillator drive level in tracking generator mode [0 to 7]; currently: " );
|
||||
Serial.println ( trackGenSetting.IF_Drive );
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
Serial.print ( " TGOFFSET......Tracking generator offset from SA IF; currently: " );
|
||||
Serial.println ( trackGenSetting.Offset );
|
||||
Serial.print ( " TGFREQ........Tracking generator signal generator frequency; currently: " );
|
||||
@ -876,7 +876,7 @@ uint8_t reg69; // Ditto
|
||||
return true;
|
||||
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
|
||||
case MSG_TGSIG:
|
||||
SetTracking(2);
|
||||
@ -906,7 +906,7 @@ uint8_t reg69; // Ditto
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
/*
|
||||
* The "TGRXDRIVE" command sets the receiver (IF) oscillator "drive" level in tracking generator mode.
|
||||
*/
|
||||
@ -970,11 +970,11 @@ uint8_t reg69; // Ditto
|
||||
|
||||
if ( VFO == TX_4432 ) // Transmitter?
|
||||
xmit.SetFrequency ( freq1 );
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
if ( VFO == TGIF_4432 ) // Track generator IF?
|
||||
tg_if.SetFrequency ( freq1 );
|
||||
#endif
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
if ( VFO == TGLO_4432 ) // Track generator IF?
|
||||
tg_lo.SetFrequency ( freq1 );
|
||||
#endif
|
||||
@ -985,11 +985,11 @@ uint8_t reg69; // Ditto
|
||||
|
||||
if ( VFO == TX_4432 ) // Local Oscillator?
|
||||
Serial.printf( "LO frequency: %s\n", FormatFrequency ( xmit.GetFrequency() ));
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
if ( VFO == TGIF_4432 ) // Local Oscillator?
|
||||
Serial.printf( "TG IF frequency: %s\n", FormatFrequency ( tg_if.GetFrequency() ));
|
||||
#endif
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
if ( VFO == TGLO_4432 ) // Local Oscillator?
|
||||
Serial.printf( "TG LO frequency: %s\n", FormatFrequency ( tg_lo.GetFrequency() ));
|
||||
#endif
|
||||
@ -1079,11 +1079,11 @@ uint8_t reg69; // Ditto
|
||||
|| ( dataBuff[0] == 'T' )) // Transmitter?
|
||||
VFO = TX_4432;
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
else if ( dataBuff[0] == 'I' ) // track gen IF
|
||||
VFO = TGIF_4432;
|
||||
#endif
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
else if ( dataBuff[0] == 'G' ) // track gen LO
|
||||
VFO = TGLO_4432;
|
||||
#endif
|
||||
@ -1228,14 +1228,14 @@ uint8_t reg69; // Ditto
|
||||
Serial.println ( "\nTransmitter (LO) registers:\n" );
|
||||
xmit.PrintRegs();
|
||||
}
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
if ( VFO == TGIF_4432 ) // Track generator IF
|
||||
{
|
||||
Serial.println ( "\nTracking Generator IF registers:\n" );
|
||||
tg_if.PrintRegs();
|
||||
}
|
||||
#endif
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
if ( VFO == TGLO_4432 ) // Track generator Lo
|
||||
{
|
||||
Serial.println ( "\nTracking Generator LO registers:\n" );
|
||||
@ -1370,11 +1370,11 @@ uint8_t reg69; // Ditto
|
||||
if ( VFO == TX_4432 ) // Transmitter?
|
||||
xmit.WriteByte ( addr, tempValue ); // Send data to the device
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
if ( VFO == TGIF_4432 ) // Track gen IF
|
||||
tg_if.WriteByte ( addr, tempValue ); // Send data to the device
|
||||
#endif
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
if ( VFO == TGLO_4432 ) // Track gen LO
|
||||
tg_lo.WriteByte ( addr, tempValue ); // Send data to the device
|
||||
#endif
|
||||
@ -1392,11 +1392,11 @@ uint8_t reg69; // Ditto
|
||||
|
||||
else if ( VFO == TX_4432 ) // Transmitter?
|
||||
Serial.printf ( "TX Reg[0x%02X] = 0x%02X\n", addr, xmit.ReadByte ( addr ));
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
else if ( VFO == TGIF_4432 ) // Transmitter?
|
||||
Serial.printf ( "TGIF Reg[0x%02X] = 0x%02X\n", addr, tg_if.ReadByte ( addr ));
|
||||
#endif
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
else if ( VFO == TGLO_4432 ) // Transmitter?
|
||||
Serial.printf ( "TGLO Reg[0x%02X] = 0x%02X\n", addr, tg_lo.ReadByte ( addr ));
|
||||
#endif
|
||||
@ -1429,14 +1429,14 @@ uint8_t reg69; // Ditto
|
||||
xmit.Tune ( tempValue ); // Tune it
|
||||
config.TX_capacitance = tempValue; // And save it
|
||||
}
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
if ( VFO == TGIF_4432 ) // Trackgen IF
|
||||
{
|
||||
tg_if.Tune ( tempValue ); // Tune it
|
||||
config.tgIF_capacitance = tempValue; // And save it
|
||||
}
|
||||
#endif
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
if ( VFO == TGLO_4432 ) // Track Gen LO
|
||||
{
|
||||
tg_lo.Tune ( tempValue ); // Tune it
|
||||
@ -1457,14 +1457,14 @@ uint8_t reg69; // Ditto
|
||||
Serial.printf ( "TX capacitance: 0x%2X\n", tempValue );
|
||||
}
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
if ( VFO == TGIF_4432 ) // Tracking gen IF
|
||||
{
|
||||
tempValue = tg_if.ReadByte ( REG_COLC ); // Get current setting
|
||||
Serial.printf ( "TGIF capacitance: 0x%2X\n", tempValue );
|
||||
}
|
||||
#endif
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
if ( VFO == TGLO_4432 ) // Tracking gen LO
|
||||
{
|
||||
tempValue = tg_lo.ReadByte ( REG_COLC ); // Get current setting
|
||||
@ -2646,7 +2646,7 @@ void SetSGPower ( int16_t dBm )
|
||||
changedSetting = true;
|
||||
}
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
/*
|
||||
* "SetTGLoDrive" sets the transmitter max output level for the tracking generator.
|
||||
*
|
||||
@ -2682,7 +2682,7 @@ int oldLevel = trackGenSetting.LO_Drive;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
/*
|
||||
* "SetTGIfDrive" sets the transmitter output level for the tracking generator IF.
|
||||
*
|
||||
@ -2717,7 +2717,7 @@ int oldLevel = trackGenSetting.IF_Drive;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef TG_IF_INSTALLED
|
||||
void SetTGPower ( int16_t dBm )
|
||||
{
|
||||
// Add algorithm to set attenuator and IF drive level
|
||||
@ -2738,6 +2738,8 @@ void SetTGPower ( int16_t dBm )
|
||||
trackGenSetting.Power = dBm; // saved in SetTGIFDrive
|
||||
SetTGIfDrive ( level );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Set Tracking generator IF offset from main SA IF
|
||||
|
18
my_SA.h
18
my_SA.h
@ -191,21 +191,23 @@
|
||||
|
||||
/*
|
||||
* An option is add more SI4432 devices to make a tracking generator
|
||||
* Options for a single one where the LO is tapped off from the TinySA LO
|
||||
* Options are for a single one producing the IF where the LO is tapped off from the TinySA LO
|
||||
* or two where the track gen LO is generated with another SI4432 to give improved
|
||||
* isolation and therefore better dynamic range.
|
||||
* Do NOT comment out these definitions if you plan to install/test with TG physically
|
||||
* installed.
|
||||
*
|
||||
* Fit a pull down resistor to the TinySa and and pull up to the track gen
|
||||
* During power up if the pin is low then TinySA knows the track gen is not connected
|
||||
* if the pin is pulled high the the trackin gen is present and the TinySA will initialise it
|
||||
* and set the appropriate frequency.
|
||||
*
|
||||
* Comment both lines out if you will never use the tracking generator or have not fitted
|
||||
* the pull down resistors
|
||||
*/
|
||||
#define SI_TG_IF_CS 2 // pin to use for tracking gen IF SI4432
|
||||
#define SI_TG_LO_CS 25 // pin to use for tracking gen LO SI4432
|
||||
|
||||
/*
|
||||
* Comment both lines below out if you do not have the tracking generator
|
||||
* If only one SI4432 comment out the TG_LO_INSTALLED line
|
||||
* Leave both uncommented if you have the two SI4432 TG option
|
||||
*/
|
||||
#define TG_IF_INSTALLED
|
||||
#define TG_LO_INSTALLED
|
||||
|
||||
/*
|
||||
* These two definitions are used to tune the Si4432 module frequencies. Once you have
|
||||
|
78
simpleSA.ino
78
simpleSA.ino
@ -343,11 +343,11 @@
|
||||
Si4432 rcvr ( vspi, SI_RX_CS, RX_4432 ); // Create object for the receiver
|
||||
Si4432 xmit ( vspi, SI_TX_CS, TX_4432 ); // And the transmitter (local oscillator)
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
Si4432 tg_if ( vspi, SI_TG_IF_CS, TGIF_4432 ); // Create object for the tracking generator IF SI4432
|
||||
#endif
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
Si4432 tg_lo ( vspi, SI_TG_LO_CS, TGLO_4432 ); // Create object for the tracking generator LO SI4432
|
||||
#endif
|
||||
|
||||
@ -356,8 +356,8 @@
|
||||
* Global definitions:
|
||||
*/
|
||||
|
||||
bool tgIF_OK; // true if the tracking generator IF SI4432 is pesent and initialised OK
|
||||
bool tgLO_OK; // true if the tracking generator LO SI4432 is pesent and initialised OK
|
||||
bool tgIF_OK; // true if the tracking generator IF SI4432 is present and initialised OK
|
||||
bool tgLO_OK; // true if the tracking generator LO SI4432 is present and initialised OK
|
||||
|
||||
uint8_t numberOfWebsocketClients; // How many connections
|
||||
uint16_t wiFiPoints; // Push data to the wifi clinets when this many points collected
|
||||
@ -664,11 +664,24 @@ bool fsStatus = false; // True if SPIFFS loads ok
|
||||
// tft.println("VSPI started");
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Set the CS pins normally used for the SI4432 to high, so if present they do not interfere
|
||||
* with the bus signals
|
||||
*
|
||||
*/
|
||||
pinMode (SI_TG_LO_CS, OUTPUT);
|
||||
digitalWrite(SI_TG_LO_CS, HIGH); // make sure the module doesn't get selected
|
||||
|
||||
pinMode (SI_TG_IF_CS, OUTPUT);
|
||||
digitalWrite(SI_TG_IF_CS, HIGH); // make sure the module doesn't get selected
|
||||
|
||||
|
||||
/*
|
||||
* Initialize the SI4432 for RX and LO(TX)
|
||||
*/
|
||||
|
||||
tft.setCursor(0,160);
|
||||
tft.setCursor(0,120);
|
||||
// tft.println ( "Initializing TX SI4432" );
|
||||
|
||||
if ( ! xmit.Init ( config.TX_capacitance ) ) // Initialize the transmitter module
|
||||
@ -692,39 +705,22 @@ bool fsStatus = false; // True if SPIFFS loads ok
|
||||
// If the tracking generator IF SI4432 is defined, then check to see if it is connected
|
||||
tgIF_OK = false;
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
// pinMode (SI_TG_IF_CS, INPUT); //Start off in input mode, no pullup
|
||||
// delay(2);
|
||||
// if (digitalRead (SI_TG_IF_CS) ) {
|
||||
// // Tracking gen IF present - initialise it
|
||||
// pinMode (SI_TG_IF_CS, OUTPUT);
|
||||
// delay(2);
|
||||
// tgIF_OK = tg_if.Init ( config.tgIF_capacitance );
|
||||
#ifdef TG_IF_INSTALLED
|
||||
|
||||
tft.setCursor(0,180);
|
||||
tft.setCursor(0,150);
|
||||
tft.println ( "Initializing track gen IF SI4432" );
|
||||
if ( tg_if.Init ( config.tgIF_capacitance ) )
|
||||
|
||||
tgIF_OK = tg_if.Init ( config.tgIF_capacitance );
|
||||
if ( tgIF_OK )
|
||||
{
|
||||
tft.println ("Tracking IF initialised");
|
||||
tgIF_OK = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayError ( ERR_WARN,
|
||||
"Track gen IF SI4432 failed",
|
||||
"to initialise", NULL, NULL );
|
||||
tgIF_OK = false;
|
||||
}
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Serial.println("Track gen IF SI4432 not detected");
|
||||
// pinMode (SI_TG_IF_CS, OUTPUT);
|
||||
// digitalWrite(SI_TG_IF_CS, HIGH); // make sure it doesn't get selected
|
||||
// }
|
||||
#else
|
||||
pinMode (2, OUTPUT);
|
||||
digitalWrite(2, HIGH); // make sure it doesn't get selected
|
||||
#endif
|
||||
|
||||
|
||||
@ -732,13 +728,7 @@ bool fsStatus = false; // True if SPIFFS loads ok
|
||||
// If the tracking generator LO SI4432 is defined, then check to see if it is connected
|
||||
tgLO_OK = false;
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
// pinMode (SI_TG_LO_CS, INPUT); //Start off in input mode, no pullup
|
||||
// delay(2);
|
||||
// if (digitalRead (SI_TG_LO_CS) ) {
|
||||
// // Tracking gen LO present - initialise it, but not in TX mode yet
|
||||
// pinMode (SI_TG_LO_CS, OUTPUT);
|
||||
// delay(2);
|
||||
#ifdef TG_LO_INSTALLED
|
||||
|
||||
tft.println ( "Initializing track gen LO SI4432" );
|
||||
|
||||
@ -746,19 +736,11 @@ bool fsStatus = false; // True if SPIFFS loads ok
|
||||
if ( tgLO_OK )
|
||||
tft.println ("Tracking LO initialised");
|
||||
else
|
||||
{
|
||||
DisplayError ( ERR_WARN,
|
||||
"Track gen LO SI4432 failed",
|
||||
"to initialise", NULL, NULL );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Serial.println("Track gen LO SI4432 not detected");
|
||||
// pinMode (SI_TG_LO_CS, OUTPUT);
|
||||
// digitalWrite(SI_TG_LO_CS, HIGH); // make sure it doesn't get selected
|
||||
// }
|
||||
#else
|
||||
pinMode (25, OUTPUT);
|
||||
digitalWrite(25, HIGH); // make sure it doesn't get selected
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -1124,14 +1106,14 @@ void init_sweep()
|
||||
xmit.SetDrive ( setting.Drive ); // Set transmitter power level
|
||||
rcvr.SetPreampGain ( setting.PreampGain );
|
||||
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
if (tgIF_OK) {
|
||||
tg_if.TxMode ( trackGenSetting.IF_Drive ); // turn on the IF oscillator in tracking generator
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
if (tgLO_OK) {
|
||||
tg_lo.TxMode ( trackGenSetting.LO_Drive ); // turn on the Local Oscillator in tracking generator
|
||||
}
|
||||
@ -1570,6 +1552,8 @@ double fStop;
|
||||
else
|
||||
sSprite.print ( " OFF" );
|
||||
|
||||
if (tgIF_OK)
|
||||
{
|
||||
sSprite.setCursor ( 0, HALF_CHAR_H * 48 );
|
||||
sSprite.println ( "Trk" );
|
||||
|
||||
@ -1579,7 +1563,7 @@ double fStop;
|
||||
sSprite.print ( " SIG" );
|
||||
else
|
||||
sSprite.print ( " OFF" );
|
||||
|
||||
}
|
||||
|
||||
if ( USE_WIFI )
|
||||
{
|
||||
|
@ -364,10 +364,11 @@ void webSocketEvent ( uint8_t num, WStype_t type, uint8_t* payload, size_t paylo
|
||||
case 's': // Adjust sweep span
|
||||
SetSweepSpan ( (int32_t) ( value * 1000000.0 ));
|
||||
break;
|
||||
|
||||
#ifdef TG_IF_INSTALLED
|
||||
case 't': // Tracking Generator off/on/generate
|
||||
SetTracking ( (int8_t)value );
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 'A': // Internal Attenuation (PE4302)
|
||||
SetAttenuation ( value );
|
||||
@ -398,9 +399,11 @@ void webSocketEvent ( uint8_t num, WStype_t type, uint8_t* payload, size_t paylo
|
||||
SetSpur ( (int8_t)value );
|
||||
break;
|
||||
|
||||
#ifdef TG_IF_INSTALLED
|
||||
case 'T': // Tracking Generator output power (dBm)
|
||||
SetTGPower ( value );
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
Serial.printf ( "payload[1] was %c\n", payload[1] );
|
||||
|
22
ui.cpp
22
ui.cpp
@ -61,10 +61,10 @@ extern uint8_t AGC_Reg; // Fixed value for preampGain if not auto
|
||||
|
||||
extern Si4432 rcvr; // Si4432 Receiver object
|
||||
extern Si4432 xmit; // Si4432 Transmitter object
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
extern Si4432 tg_if; // Si4432 Tracking Generator IF
|
||||
#endif
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
extern Si4432 tg_lo; // Si4432 Tracking Generator LO
|
||||
#endif
|
||||
|
||||
@ -485,12 +485,12 @@ static Menuitem menu_generate[] = // Frequency generator mode
|
||||
Menuitem ( MT_END ) // End marker
|
||||
};
|
||||
|
||||
|
||||
#ifdef TG_IF_INSTALLED
|
||||
static Menuitem menu_tracking[] = // Tracking generator mode
|
||||
{
|
||||
Menuitem ( MT_FUNC, "OFF", menu_tracking_cb ),
|
||||
Menuitem ( MT_FUNC, "ON", menu_tracking_cb ),
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
Menuitem ( MT_FUNC, "GENERATE", menu_tracking_cb ),
|
||||
Menuitem ( MT_FUNC, "FREQUENCY",menu_tg_frequency_cb ),
|
||||
Menuitem ( MT_FUNC, "OFFSET", menu_tg_offset_cb ),
|
||||
@ -500,7 +500,7 @@ static Menuitem menu_tracking[] = // Tracking generator mode
|
||||
Menuitem ( MT_BACK, "<-BACK" ), // Next level up
|
||||
Menuitem ( MT_END ) // End marker
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
static Menuitem menu_spur[] = // Turn spurious suppression on or off
|
||||
{
|
||||
@ -687,7 +687,7 @@ static Menuitem menu_output[] = // The "OUTPUT" menu
|
||||
{
|
||||
Menuitem ( MT_MENU, "REFERENCE", menu_refer ), // Select GPIO2 reference frequency
|
||||
Menuitem ( MT_FUNC, "GENERATOR", menu_generate_cb ), // Turn generator mode on or off
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
Menuitem ( MT_MENU, "TRACKING", menu_tracking ), // Tracking generator control
|
||||
#endif
|
||||
Menuitem ( MT_BACK, "<-BACK" ), // Next level up
|
||||
@ -2937,14 +2937,14 @@ static int keypad_click ( int key )
|
||||
rcvr.Tune ( ( uint8_t ) value ); // Tune it
|
||||
config.RX_capacitance = ( uint8_t ) value; // And save it
|
||||
}
|
||||
#ifdef SI_TG_IF_CS
|
||||
#ifdef TG_IF_INSTALLED
|
||||
else if ( VFO == TGIF_4432 ) // Tracking generator IF module selected?
|
||||
{
|
||||
tg_if.Tune ( ( uint8_t ) value ); // Tune it
|
||||
config.tgIF_capacitance = ( uint8_t ) value; // And save it
|
||||
}
|
||||
#endif
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
else if ( VFO == TGLO_4432 ) // Tracking generator LO module selected?
|
||||
{
|
||||
tg_lo.Tune ( ( uint8_t ) value ); // Tune it
|
||||
@ -2984,7 +2984,7 @@ static int keypad_click ( int key )
|
||||
SetTGFreq ( (int32_t)value );
|
||||
break;
|
||||
|
||||
|
||||
#ifdef TG_IF_INSTALLED
|
||||
case KM_TGIF_DRIVE:
|
||||
if ( (value > MAX_DRIVE) || (value < MIN_DRIVE) )
|
||||
{
|
||||
@ -2997,9 +2997,9 @@ static int keypad_click ( int key )
|
||||
else
|
||||
SetTGIfDrive ( (uint8_t)value );
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SI_TG_LO_CS
|
||||
#ifdef TG_LO_INSTALLED
|
||||
case KM_TGLO_DRIVE:
|
||||
if ( (value > MAX_DRIVE) || (value < MIN_DRIVE) )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user