diff ad9912.c @ 201:f8118b90490e

Fix new AD9912 interface
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Mon, 31 Mar 2014 17:03:37 +0200
parents 87dae6d62a61
children 9e0c3541104b
line wrap: on
line diff
--- 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;