Skip to content

Commit 453e8b7

Browse files
committedNov 6, 2016
runtime: support configurations without moninj, log or dds
1 parent 7dcc987 commit 453e8b7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
 

‎artiq/runtime.rs/libksupport/api.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,16 @@ static mut API: &'static [(&'static str, *const ())] = &[
105105
api!(rtio_input_timestamp),
106106
api!(rtio_input_data),
107107

108-
// #if ((defined CONFIG_RTIO_DDS_COUNT) && (CONFIG_RTIO_DDS_COUNT > 0))
108+
#[cfg(rtio_dds_count)]
109109
api!(dds_init),
110+
#[cfg(rtio_dds_count)]
110111
api!(dds_init_sync),
112+
#[cfg(rtio_dds_count)]
111113
api!(dds_batch_enter),
114+
#[cfg(rtio_dds_count)]
112115
api!(dds_batch_exit),
116+
#[cfg(rtio_dds_count)]
113117
api!(dds_set),
114-
// #endif
115118

116119
api!(i2c_init),
117120
api!(i2c_start),

‎artiq/runtime.rs/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ mod rpc_proto;
7575

7676
mod kernel;
7777
mod session;
78+
#[cfg(has_rtio_moninj)]
7879
mod moninj;
7980
#[cfg(has_rtio_analyzer)]
8081
mod analyzer;
@@ -109,6 +110,7 @@ pub unsafe extern fn rust_main() {
109110

110111
let mut scheduler = sched::Scheduler::new();
111112
scheduler.spawner().spawn(16384, session::thread);
113+
#[cfg(has_rtio_moninj)]
112114
scheduler.spawner().spawn(4096, moninj::thread);
113115
#[cfg(has_rtio_analyzer)]
114116
scheduler.spawner().spawn(4096, analyzer::thread);

‎artiq/runtime/rtio.c

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ unsigned int rtio_input_data(int channel)
124124

125125
void rtio_log_va(long long int timestamp, const char *fmt, va_list args)
126126
{
127+
#ifdef CONFIG_RTIO_LOG_CHANNEL
127128
// This executes on the kernel CPU's stack, which is specifically designed
128129
// for allocation of this kind of massive buffers.
129130
int len = vsnprintf(NULL, 0, fmt, args);
@@ -152,6 +153,7 @@ void rtio_log_va(long long int timestamp, const char *fmt, va_list args)
152153
i = 0;
153154
}
154155
}
156+
#endif
155157
}
156158

157159
void rtio_log(long long int timestamp, const char *fmt, ...)

0 commit comments

Comments
 (0)
Please sign in to comment.