runtime: fix AD9914 register read in bridge

This commit is contained in:
Sebastien Bourdeauducq 2015-08-21 17:51:01 +08:00
parent d4f42e33e6
commit 8d8aa32aed
1 changed files with 7 additions and 1 deletions

View File

@ -20,7 +20,13 @@ static int dds_read(int addr)
{
int r;
dds_write(addr | 128, 0);
#ifdef DDS_AD9858
#define DDS_READ_FLAG 128
#endif
#ifdef DDS_AD9914
#define DDS_READ_FLAG 256
#endif
dds_write(addr | DDS_READ_FLAG, 0);
while(rtio_i_status_read() & RTIO_I_STATUS_EMPTY);
r = rtio_i_data_read();
rtio_i_re_write(1);