comparison DDS_Fox.c @ 72:8e6a2ec85169

Fix byte order in AD9956 DDS driver
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Mon, 29 Oct 2012 16:13:27 +0100
parents 64a7a1d3d75c
children e5ad3ed47d2c
comparison
equal deleted inserted replaced
71:07caeaeb5b88 72:8e6a2ec85169
433 static void convert_double_6char (double fraction, unsigned char* octets) 433 static void convert_double_6char (double fraction, unsigned char* octets)
434 { 434 {
435 // 64 bits integer 435 // 64 bits integer
436 unsigned long long x = fraction; 436 unsigned long long x = fraction;
437 for (int i = 0; i < 6; i++) 437 for (int i = 0; i < 6; i++)
438 octets[5 - i] = (unsigned char)((x >> (i * 8)) & 0xFF); 438 octets[i] = (unsigned char)((x >> (i * 8)) & 0xFF);
439 } 439 }