wods (rpitx pr 243)

This commit is contained in:
Kuba 2023-11-19 16:25:07 +00:00
parent 39611a1da4
commit d2fea1155a
2 changed files with 12 additions and 10 deletions

View File

@ -14,7 +14,7 @@
// 2-sendiq is started with the -m {token} argument, without it no shared memory commands
// are honored.
// 3-Partner program willing to alter the operation of sendiq place the
// appropriate commnand plus optional associated data and/or common_data
// appropriate command plus optional associated data and/or common_data
// if needed (see table below).
// 4-Partner program set updated=true.
// 5-sendiq checks periodically for condition updated==true.
@ -31,7 +31,7 @@
// 4444 Change Frequency Frequency in Hz N/A
// ---------------------------------------------------------------------------
//
// Note: with current level if shared memory is enabled the data incoming thru standar input
// Note: with current level if shared memory is enabled the data incoming thru standart input
// or file is expected to be in float format. Other data formats aren't supported together with
// commands, for them sendiq will work but no commands will be honored.
//
@ -133,7 +133,7 @@ int main(int argc, char* argv[])
sharedmem_token = atoi(optarg);
InputType=typeiq_float; //if using shared memory force float pipe
break;
case 's': // SampleRate (Only needeed in IQ mode)
case 's': // SampleRate (Only needed in IQ mode)
SampleRate = atoi(optarg);
if(SampleRate>MAX_SAMPLERATE)
{
@ -163,7 +163,7 @@ int main(int argc, char* argv[])
case 'l': // loop mode
loop_mode_flag = true;
break;
case 't': // inout type
case 't': // input type
if(strcmp(optarg,"i16")==0) InputType=typeiq_i16;
if(strcmp(optarg,"u8")==0) InputType=typeiq_u8;
if(strcmp(optarg,"float")==0) InputType=typeiq_float;

View File

@ -7,7 +7,7 @@
bool running=true;
#define PROGRAM_VERSION "0.1"
#define PROGRAM_VERSION "0.2"
void print_usage(void)
@ -41,6 +41,7 @@ int main(int argc, char* argv[])
dbg_setlevel(1);
bool NotKill=false;
float ppm=1000.0;
int ppmset=0;
while(1)
{
a = getopt(argc, argv, "f:ehp:");
@ -55,13 +56,14 @@ int main(int argc, char* argv[])
switch(a)
{
case 'f': // Frequency
SetFrequency = atof(optarg);
SetFrequency = strtof(optarg);
break;
case 'e': //End immediately
NotKill=true;
break;
case 'p': //ppm
ppm=atof(optarg);
ppm=std::strtof(optarg);
ppmset=1;
break;
case 'h': // help
print_usage();
@ -105,14 +107,14 @@ int main(int argc, char* argv[])
pad.setlevel(7);
clkgpio *clk=new clkgpio;
clk->SetAdvancedPllMode(true);
if(ppm!=1000) //ppm is set else use ntp
if(ppmset) //ppm is set else use ntp
clk->Setppm(ppm);
clk->SetCenterFrequency(SetFrequency,10);
clk->SetFrequency(000);
clk->enableclk(4);
//clk->enableclk(6);//CLK2 : experimental
//clk->enableclk(20);//CLK1 duplicate on GPIO20 for more power ? (kuba's note: it can extend range, but not far (depending on the antenna), also no more power, because its impossible)
//clk->enableclk(20);//CLK1 duplicate on GPIO20 for more power ? (kuba's note: it can extend range, but not far (depending on the antenna), also no more power, because its impossible, you cant get more than your receiving, youd need to receive more then and not appear it out of nowhere)
if(!NotKill)
{
while(running)
@ -125,7 +127,7 @@ int main(int argc, char* argv[])
}
else
{
//Ugly method : not destroying clk object will not call destructor thus leaving clk running
//Ugly method : not destroying clk object will not call destructor thus leaving clk running, until a new transmission starts
}