runtime: support for targets without I2C

This commit is contained in:
Sebastien Bourdeauducq 2016-11-23 10:43:33 +08:00
parent fbd83cf9ee
commit cd40d5b107
2 changed files with 6 additions and 0 deletions

View File

@ -105,9 +105,14 @@ static mut API: &'static [(&'static str, *const ())] = &[
api!(rtio_input_timestamp = ::rtio::input_timestamp), api!(rtio_input_timestamp = ::rtio::input_timestamp),
api!(rtio_input_data = ::rtio::input_data), api!(rtio_input_data = ::rtio::input_data),
#[cfg(has_i2c)]
api!(i2c_init = ::i2c::init), api!(i2c_init = ::i2c::init),
#[cfg(has_i2c)]
api!(i2c_start = ::i2c::start), api!(i2c_start = ::i2c::start),
#[cfg(has_i2c)]
api!(i2c_stop = ::i2c::stop), api!(i2c_stop = ::i2c::stop),
#[cfg(has_i2c)]
api!(i2c_write = ::i2c::write), api!(i2c_write = ::i2c::write),
#[cfg(has_i2c)]
api!(i2c_read = ::i2c::read), api!(i2c_read = ::i2c::read),
]; ];

View File

@ -50,6 +50,7 @@ macro_rules! artiq_raise {
} }
mod rtio; mod rtio;
#[cfg(has_i2c)]
mod i2c; mod i2c;
use core::{mem, ptr, slice, str}; use core::{mem, ptr, slice, str};