forked from M-Labs/artiq
1
0
Fork 0

firmware: Treat timestamps consistently as signed [nfc]

This matches other functions and the ARTIQ Python side, but
isn't actually an ABI change.
This commit is contained in:
David Nadlinger 2018-12-12 00:37:48 +00:00
parent 38ce7ab8ff
commit 8e30c4574b
1 changed files with 4 additions and 4 deletions

View File

@ -94,7 +94,7 @@ mod imp {
} }
} }
pub extern fn input_timestamp(timeout: i64, channel: i32) -> u64 { pub extern fn input_timestamp(timeout: i64, channel: i32) -> i64 {
unsafe { unsafe {
csr::rtio::target_write((channel as u32) << 8); csr::rtio::target_write((channel as u32) << 8);
csr::rtio::i_timeout_write(timeout as u64); csr::rtio::i_timeout_write(timeout as u64);
@ -111,7 +111,7 @@ mod imp {
channel as i64, 0, 0); channel as i64, 0, 0);
} }
if status & RTIO_I_STATUS_WAIT_EVENT != 0 { if status & RTIO_I_STATUS_WAIT_EVENT != 0 {
return !0 return -1
} }
if status & RTIO_I_STATUS_DESTINATION_UNREACHABLE != 0 { if status & RTIO_I_STATUS_DESTINATION_UNREACHABLE != 0 {
raise!("RTIODestinationUnreachable", raise!("RTIODestinationUnreachable",
@ -119,7 +119,7 @@ mod imp {
channel as i64, 0, 0); channel as i64, 0, 0);
} }
csr::rtio::i_timestamp_read() csr::rtio::i_timestamp_read() as i64
} }
} }
@ -200,7 +200,7 @@ mod imp {
unimplemented!("not(has_rtio)") unimplemented!("not(has_rtio)")
} }
pub extern fn input_timestamp(_timeout: i64, _channel: i32) -> u64 { pub extern fn input_timestamp(_timeout: i64, _channel: i32) -> i64 {
unimplemented!("not(has_rtio)") unimplemented!("not(has_rtio)")
} }