From 96756b1aaa91dda11f8759d91657c1ff35df9f90 Mon Sep 17 00:00:00 2001 From: mog422 Date: Mon, 28 Oct 2013 22:46:28 +0900 Subject: [PATCH] Fix couldn't calculate correct fequency --- PiFmDma/PiFmDma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PiFmDma/PiFmDma.c b/PiFmDma/PiFmDma.c index 5e7f59a..0c2e855 100644 --- a/PiFmDma/PiFmDma.c +++ b/PiFmDma/PiFmDma.c @@ -262,7 +262,7 @@ main(int argc, char **argv) // Calculate the frequency control word // The fractional part is stored in the lower 12 bits - freq_ctl = ((float)(PLLFREQ / CARRIERFREQ)) * ( 1 << 12 ); + freq_ctl = ((float)((float)PLLFREQ / (float)CARRIERFREQ)) * ( 1 << 12 ); dma_reg = map_peripheral(DMA_BASE, DMA_LEN); pwm_reg = map_peripheral(PWM_BASE, PWM_LEN);