From 2925373382aba3bcc661a52b8b70c1a35a62bb99 Mon Sep 17 00:00:00 2001 From: F5OEO Date: Mon, 19 Mar 2018 12:31:18 +0000 Subject: [PATCH] Increase frequency precision in DMA --- src/gpio.cpp | 2 +- src/gpio.h | 2 +- src/ngfmdmasync.cpp | 2 +- src/ngfmdmasync.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gpio.cpp b/src/gpio.cpp index 2a99594..3cd86d8 100644 --- a/src/gpio.cpp +++ b/src/gpio.cpp @@ -161,7 +161,7 @@ int clkgpio::SetFrequency(double Frequency) } -uint32_t clkgpio::GetMasterFrac(int Frequency) +uint32_t clkgpio::GetMasterFrac(double Frequency) { if(ModulateFromMasterPLL) { diff --git a/src/gpio.h b/src/gpio.h index 1c39264..e029f73 100644 --- a/src/gpio.h +++ b/src/gpio.h @@ -163,7 +163,7 @@ class clkgpio:public gpio int SetCenterFrequency(uint64_t Frequency,int Bandwidth); int ComputeBestLO(uint64_t Frequency,int Bandwidth); int SetMasterMultFrac(uint32_t Mult,uint32_t Frac); - uint32_t GetMasterFrac(int Frequency); + uint32_t GetMasterFrac(double Frequency); void enableclk(int gpio); void disableclk(int gpio); diff --git a/src/ngfmdmasync.cpp b/src/ngfmdmasync.cpp index fd7bbd8..3611408 100644 --- a/src/ngfmdmasync.cpp +++ b/src/ngfmdmasync.cpp @@ -106,7 +106,7 @@ void ngfmdmasync::SetDmaAlgo() //fprintf(stderr,"Last cbp : src %x dest %x next %x\n",cbp->src,cbp->dst,cbp->next); } -void ngfmdmasync::SetFrequencySample(uint32_t Index,int Frequency) +void ngfmdmasync::SetFrequencySample(uint32_t Index,double Frequency) { Index=Index%buffersize; sampletab[Index]=(0x5A<<24)|GetMasterFrac(Frequency); diff --git a/src/ngfmdmasync.h b/src/ngfmdmasync.h index 872df8f..d55fe6e 100644 --- a/src/ngfmdmasync.h +++ b/src/ngfmdmasync.h @@ -16,7 +16,7 @@ class ngfmdmasync:public bufferdma,public clkgpio,public pwmgpio,public pcmgpio void SetDmaAlgo(); void SetPhase(bool inversed); - void SetFrequencySample(uint32_t Index,int Frequency); + void SetFrequencySample(uint32_t Index,double Frequency); }; #endif