# HG changeset patch # User Daniele Nicolodi # Date 1396278217 -7200 # Node ID f8118b90490e4e7172f60e93ef63643b271bfd99 # Parent 0e0282010be36574a72f3c5b4f6743c71c02f0a0 Fix new AD9912 interface diff -r 0e0282010be3 -r f8118b90490e ad9912.c --- a/ad9912.c Mon Mar 31 17:03:37 2014 +0200 +++ b/ad9912.c Mon Mar 31 17:03:37 2014 +0200 @@ -32,7 +32,7 @@ static inline uint64 ftw(double clock, double freq) { - uint64 ftw = freq * ((double)(1 << 48) / clock); + uint64 ftw = freq * ((double)(1ULL << 48) / clock); ftw = ftw & ~1ULL; return ftw; } @@ -170,7 +170,7 @@ int r; uint64 value = ftw(d->clock, f); - r = command(d->fd, "SET CH%d:FTW0 0x%llX", channel, f); + r = command(d->fd, "SET CH%d:FTW0 0x%llX", channel, value); if (r < 0) return r;