Commit 2cbc4708 authored by David Brown's avatar David Brown Committed by David Brown
Browse files

sim: Move simflash to be its own crate

In preparation for moving the bootutil binding into a separate crate,
move the flash simulator into its own crate.  This will allow the
binding to have access to the simulator without creating a circular
dependency.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 7ddec0b5
Loading
Loading
Loading
Loading
+8 −1
Changes for sim/Cargo.lock: 8 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -4,12 +4,12 @@ version = "0.1.0"
dependencies = [
 "docopt 0.6.86 (registry+https://github.com/rust-lang/crates.io-index)",
 "env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 "error-chain 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
 "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)",
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
 "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
 "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
 "simflash 0.1.0",
]

[[package]]
@@ -157,6 +157,13 @@ name = "rustc-serialize"
version = "0.3.22"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "simflash"
version = "0.1.0"
dependencies = [
 "error-chain 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "strsim"
version = "0.5.2"
+1 −1
Changes for sim/Cargo.toml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -10,11 +10,11 @@ gcc = "0.3.38"
[dependencies]
libc = "0.2.0"
rand = "0.3.0"
error-chain = "0.7.1"
docopt = "0.6"
rustc-serialize = "0.3"
log = "0.3"
env_logger = "0.3"
simflash = { path = "simflash" }

[profile.test]
opt-level = 1
+1
Changes for sim/simflash/.gitignore: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
Cargo.lock
+7
Changes for sim/simflash/Cargo.toml: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
[package]
name = "simflash"
version = "0.1.0"
authors = ["David Brown <david.brown@linaro.org>"]

[dependencies]
error-chain = "0.7.1"
+3
Changes for sim/simflash/src/lib.rs: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@
//! This module is capable of simulating the type of NOR flash commonly used in microcontrollers.
//! These generally can be written as individual bytes, but must be erased in larger units.

#[macro_use] extern crate error_chain;
mod pdump;

use std::fs::File;
use std::io::Write;
use std::iter::Enumerate;
Loading