forked from M-Labs/artiq
1
0
Fork 0

soc/runtime: raise underflow exception for replace and DDS FUD operations

This commit is contained in:
Sebastien Bourdeauducq 2014-09-26 17:24:45 +08:00
parent af0cd902d3
commit e263b63527
2 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,7 @@
#include <hw/common.h>
#include <stdio.h>
#include "exceptions.h"
#include "dds.h"
#define DDS_FTW0 0x0a
@ -42,6 +43,8 @@ static void fud(long long int fud_time)
rtio_o_timestamp_write(fud_time+3*8);
rtio_o_value_write(0);
rtio_o_we_write(1);
if(rtio_o_error_read())
exception_raise(EID_RTIO_UNDERFLOW);
if(r) {
fud_sync();

View File

@ -32,6 +32,8 @@ void rtio_replace(long long int timestamp, int channel, int value)
rtio_o_timestamp_write(timestamp);
rtio_o_value_write(value);
rtio_o_replace_write(1);
if(rtio_o_error_read())
exception_raise(EID_RTIO_UNDERFLOW);
}
void rtio_sync(int channel)