1
0
mirror of https://github.com/richardghirst/PiBits.git synced 2025-02-26 19:54:16 +01:00

Fix couldn't calculate correct fequency

This commit is contained in:
mog422 2013-10-28 22:46:28 +09:00
parent ab34d81e53
commit 96756b1aaa

View File

@ -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);