mirror of
https://github.com/F5OEO/rpitx.git
synced 2026-03-15 12:56:57 +01:00
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
piam
|
||||
pidcf77
|
||||
pifm
|
||||
pifsq
|
||||
pissb
|
||||
pisstv
|
||||
rpitx
|
||||
*.o
|
||||
@@ -32,7 +32,9 @@ typedef struct {
|
||||
RfSample.Frequency=Frequency;
|
||||
RfSample.WaitForThisSample=Timing; //en 100 de nanosecond
|
||||
//printf("Freq =%f Timing=%d\n",RfSample.Frequency,RfSample.WaitForThisSample);
|
||||
write(FileFreqTiming,&RfSample,sizeof(samplerf_t));
|
||||
if (write(FileFreqTiming,&RfSample,sizeof(samplerf_t)) != sizeof(samplerf_t)) {
|
||||
fprintf(stderr, "Unable to write sample\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -72,7 +74,7 @@ int main(int argc, char **argv) {
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
FileFreqTiming = open(outfilename,'r');
|
||||
FileFreqTiming = open(outfilename, O_RDONLY);
|
||||
|
||||
|
||||
/** **/
|
||||
|
||||
@@ -237,7 +237,9 @@ void playtone(double Amplitude,uint32_t Timing)
|
||||
RfSample.Amplitude=Amplitude;
|
||||
RfSample.WaitForThisSample=Timing; //en 100 de nanosecond
|
||||
printf("%f %ld\n",Amplitude,Timing);
|
||||
write(FileFreqTiming,&RfSample,sizeof(samplerf_t));
|
||||
if (write(FileFreqTiming,&RfSample,sizeof(samplerf_t)) != sizeof(samplerf_t)) {
|
||||
fprintf(stderr, "Unable to write sample\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -251,7 +253,7 @@ if (argc > 1) {
|
||||
|
||||
|
||||
char *sFileFreqTiming=(char *)argv[1];
|
||||
FileFreqTiming = open(argv[1],O_WRONLY|O_CREAT);
|
||||
FileFreqTiming = open(argv[1], O_WRONLY|O_CREAT, 0644);
|
||||
|
||||
DCF_BITS(7,59);
|
||||
loop();
|
||||
|
||||
@@ -32,7 +32,9 @@ typedef struct {
|
||||
RfSample.Frequency=Frequency;
|
||||
RfSample.WaitForThisSample=Timing; //en 100 de nanosecond
|
||||
//printf("Freq =%f Timing=%d\n",RfSample.Frequency,RfSample.WaitForThisSample);
|
||||
write(FileFreqTiming,&RfSample,sizeof(samplerf_t));
|
||||
if (write(FileFreqTiming,&RfSample,sizeof(samplerf_t)) != sizeof(samplerf_t)) {
|
||||
fprintf(stderr, "Unable to write sample\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -72,7 +74,7 @@ int main(int argc, char **argv) {
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
FileFreqTiming = open(outfilename,'r');
|
||||
FileFreqTiming = open(outfilename, O_RDONLY);
|
||||
|
||||
|
||||
/** **/
|
||||
|
||||
@@ -216,7 +216,9 @@ typedef struct {
|
||||
RfSample.Frequency=Frequency;
|
||||
RfSample.WaitForThisSample=Timing*1000L; //en 100 de nanosecond
|
||||
//printf("Freq =%f Timing=%d\n",RfSample.Frequency,RfSample.WaitForThisSample);
|
||||
write(FileFreqTiming,&RfSample,sizeof(samplerf_t));
|
||||
if (write(FileFreqTiming,&RfSample,sizeof(samplerf_t)) != sizeof(samplerf_t)) {
|
||||
fprintf(stderr, "Unable to write sample\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -352,10 +354,10 @@ main(int argc, char **argv)
|
||||
if (argc > 2) {
|
||||
|
||||
sText=(char *)argv[1];
|
||||
//FileText = open(argv[1], 'r');
|
||||
//FileText = open(argv[1], O_RDONLY);
|
||||
|
||||
char *sFileFreqTiming=(char *)argv[2];
|
||||
FileFreqTiming = open(argv[2],O_WRONLY|O_CREAT);
|
||||
FileFreqTiming = open(argv[2], O_WRONLY|O_CREAT, 0644);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ LDFLAGS_Pidcf77 = -lm -lrt -lpthread
|
||||
$(CC) $(CFLAGS_Piam) -o ../pidcf77 ../dcf77/pidcf77.c $(LDFLAGS_Piam)
|
||||
clean:
|
||||
|
||||
rm -f ../rpitx ../pissb ../pisstv ../pifsq ../pifm ../piam RpiTx.o mailbox.o RpiGpio.o RpiDma.o
|
||||
rm -f ../rpitx ../pissb ../pisstv ../pifsq ../pifm ../piam ../pidcf77 RpiTx.o mailbox.o RpiGpio.o RpiDma.o
|
||||
|
||||
install: all
|
||||
install -m 0755 ../pisstv /usr/bin
|
||||
|
||||
@@ -6,8 +6,12 @@
|
||||
char InitDma(void *FunctionTerminate)
|
||||
{
|
||||
DMA_CHANNEL=4;
|
||||
system("rm linuxversion.txt");
|
||||
system("uname -r >> linuxversion.txt");
|
||||
if (system("rm -f linuxversion.txt") != 0) {
|
||||
fprintf(stderr, "rm failed\n");
|
||||
}
|
||||
if (system("uname -r >> linuxversion.txt") != 0) {
|
||||
fprintf(stderr, "uname failed\n");
|
||||
}
|
||||
char *line = NULL;
|
||||
size_t size;
|
||||
// int fLinux=open("Flinuxversion.txt", "r');
|
||||
|
||||
22
src/RpiTx.c
22
src/RpiTx.c
@@ -81,6 +81,8 @@ Optimize CPU on PWMFrequency
|
||||
#define PLLFREQ_192 19200000 //PLLA = 19.2MHZ
|
||||
#define PLL_192 0x1
|
||||
|
||||
#define HEADER_SIZE 44
|
||||
|
||||
|
||||
typedef unsigned char uchar ; // 8 bit
|
||||
typedef unsigned short uint16 ; // 16 bit
|
||||
@@ -1106,7 +1108,7 @@ main(int argc, char **argv)
|
||||
{
|
||||
FileInHandle = STDIN_FILENO;
|
||||
}
|
||||
else FileInHandle = open(FileName, 'r');
|
||||
else FileInHandle = open(FileName, O_RDONLY);
|
||||
if (FileInHandle < 0)
|
||||
{
|
||||
fatal("Failed to read Filein %s\n",FileName);
|
||||
@@ -1116,8 +1118,10 @@ main(int argc, char **argv)
|
||||
if(Mode==MODE_IQ)
|
||||
{
|
||||
IQArray=malloc(DmaSampleBurstSize*2*sizeof(signed short)); // TODO A FREE AT THE END OF SOFTWARE
|
||||
char dummyheader[44];
|
||||
read(FileInHandle,dummyheader,44);
|
||||
char dummyheader[HEADER_SIZE];
|
||||
if (read(FileInHandle,dummyheader,HEADER_SIZE) != HEADER_SIZE) {
|
||||
fatal("Unable to read header\n");
|
||||
}
|
||||
|
||||
}
|
||||
if(Mode==MODE_IQ_FLOAT)
|
||||
@@ -1297,9 +1301,11 @@ for (;;)
|
||||
{
|
||||
printf("Looping FileIn\n");
|
||||
close(FileInHandle);
|
||||
FileInHandle = open(FileName, 'r');
|
||||
char dummyheader[44];
|
||||
read(FileInHandle,dummyheader,44);
|
||||
FileInHandle = open(FileName, O_RDONLY);
|
||||
char dummyheader[HEADER_SIZE];
|
||||
if (read(FileInHandle,dummyheader,HEADER_SIZE) != HEADER_SIZE) {
|
||||
fatal("Unable to read header\n");
|
||||
}
|
||||
NbRead=read(FileInHandle,IQArray,DmaSampleBurstSize*2*2);
|
||||
}
|
||||
else
|
||||
@@ -1376,7 +1382,7 @@ for (;;)
|
||||
{
|
||||
printf("Looping FileIn\n");
|
||||
close(FileInHandle);
|
||||
FileInHandle = open(FileName, 'r');
|
||||
FileInHandle = open(FileName, O_RDONLY);
|
||||
}
|
||||
else if (FileInHandle != STDIN_FILENO)
|
||||
terminate(0);
|
||||
@@ -1450,7 +1456,7 @@ for (;;)
|
||||
{
|
||||
//printf("Looping FileIn\n");
|
||||
close(FileInHandle);
|
||||
FileInHandle = open(FileName, 'r');
|
||||
FileInHandle = open(FileName, O_RDONLY);
|
||||
NbRead=read(FileInHandle,&SampleRf,sizeof(samplerf_t));
|
||||
}
|
||||
else if (FileInHandle != STDIN_FILENO)
|
||||
|
||||
@@ -31,7 +31,9 @@ void playtone(double Frequency,uint32_t Timing)
|
||||
RfSample.Frequency=GlobalTuningFrequency+Frequency;
|
||||
RfSample.WaitForThisSample=Timing*100L; //en 100 de nanosecond
|
||||
//printf("Freq =%f Timing=%d\n",RfSample.Frequency,RfSample.WaitForThisSample);
|
||||
write(FileFreqTiming,&RfSample,sizeof(samplerf_t));
|
||||
if (write(FileFreqTiming,&RfSample,sizeof(samplerf_t)) != sizeof(samplerf_t)) {
|
||||
fprintf(stderr, "Unable to write sample");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -153,10 +155,10 @@ main(int argc, char **argv)
|
||||
if (argc > 2) {
|
||||
|
||||
char *sFilePicture=(char *)argv[1];
|
||||
FilePicture = open(argv[1], 'r');
|
||||
FilePicture = open(argv[1], O_RDONLY);
|
||||
|
||||
char *sFileFreqTiming=(char *)argv[2];
|
||||
FileFreqTiming = open(argv[2],O_WRONLY|O_CREAT);
|
||||
FileFreqTiming = open(argv[2], O_WRONLY|O_CREAT, 0644);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user