forked from M-Labs/artiq
runtime: get rid of config_dummy.rs. NFC.
Use the same strategy as elsewhere.
This commit is contained in:
parent
0ede5d8638
commit
6cbf8786d8
|
@ -1,3 +1,5 @@
|
||||||
|
#[cfg(has_spiflash)]
|
||||||
|
mod imp {
|
||||||
use core::str;
|
use core::str;
|
||||||
use std::btree_map::BTreeMap;
|
use std::btree_map::BTreeMap;
|
||||||
use byteorder::{ByteOrder, BigEndian};
|
use byteorder::{ByteOrder, BigEndian};
|
||||||
|
@ -35,7 +37,7 @@ mod lock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub use self::lock::Lock;
|
use self::lock::Lock;
|
||||||
|
|
||||||
struct Iter<'a> {
|
struct Iter<'a> {
|
||||||
data: &'a [u8],
|
data: &'a [u8],
|
||||||
|
@ -190,3 +192,29 @@ pub fn erase() -> Result<(), ()> {
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(has_spiflash))]
|
||||||
|
mod imp {
|
||||||
|
pub fn read<F: FnOnce(Result<&[u8], ()>) -> R, R>(_key: &str, f: F) -> R {
|
||||||
|
f(Err(()))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn read_str<F: FnOnce(Result<&str, ()>) -> R, R>(_key: &str, f: F) -> R {
|
||||||
|
f(Err(()))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn write(_key: &str, _value: &[u8]) -> Result<(), ()> {
|
||||||
|
Err(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn remove(_key: &str) -> Result<(), ()> {
|
||||||
|
Err(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn erase() -> Result<(), ()> {
|
||||||
|
Err(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub use self::imp::*;
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
pub fn read<F: FnOnce(Result<&[u8], ()>) -> R, R>(_key: &str, f: F) -> R {
|
|
||||||
f(Err(()))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn read_str<F: FnOnce(Result<&str, ()>) -> R, R>(_key: &str, f: F) -> R {
|
|
||||||
f(Err(()))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn write(_key: &str, _value: &[u8]) -> Result<(), ()> {
|
|
||||||
Err(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn remove(_key: &str) -> Result<(), ()> {
|
|
||||||
Err(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn erase() -> Result<(), ()> {
|
|
||||||
Err(())
|
|
||||||
}
|
|
|
@ -34,10 +34,7 @@ macro_rules! borrow_mut {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(has_spiflash)]
|
|
||||||
mod config;
|
mod config;
|
||||||
#[cfg(not(has_spiflash))]
|
|
||||||
#[path="config_dummy.rs"] mod config;
|
|
||||||
mod ethmac;
|
mod ethmac;
|
||||||
mod rtio_mgt;
|
mod rtio_mgt;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue