Skip to content

Commit 8cd8805

Browse files
committed
screen crate
1 parent d1bf0c6 commit 8cd8805

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ libtock_low_level_debug = { path = "apis/kernel/low_level_debug" }
4141
libtock_ninedof = { path = "apis/sensors/ninedof" }
4242
libtock_platform = { path = "platform" }
4343
libtock_proximity = { path = "apis/sensors/proximity" }
44-
libtock_display = { path = "apis/display" }
44+
libtock_display = { path = "apis/display/screen" }
4545
libtock_rng = { path = "apis/peripherals/rng" }
4646
libtock_runtime = { path = "runtime" }
4747
libtock_small_panic = { path = "panic_handlers/small_panic" }
@@ -83,7 +83,7 @@ members = [
8383
"apis/sensors/air_quality",
8484
"apis/sensors/ambient_light",
8585
"apis/sensors/ninedof",
86-
"apis/display",
86+
"apis/display/screen",
8787
"apis/sensors/proximity",
8888
"apis/sensors/temperature",
8989
"apis/storage/key_value",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ rust-version.workspace = true
99
description = "libtock display driver"
1010

1111
[dependencies]
12-
libtock_platform = { path = "../../platform" }
12+
libtock_platform = { path = "../../../platform" }
1313

1414
[dev-dependencies]
15-
libtock_unittest = { path = "../../unittest" }
15+
libtock_unittest = { path = "../../../unittest" }

examples/screen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fn main() {
7575
0
7676
}
7777
};
78-
let _ = writeln!(Console::writer(), " {format} bbp\n");
78+
let _ = writeln!(Console::writer(), " {format} bpp\n");
7979
}
8080

8181
// Initialize the Screen screen buffer

unittest/src/fake/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ mod ambient_light;
1616
mod buttons;
1717
mod buzzer;
1818
mod console;
19-
mod display;
2019
mod gpio;
2120
pub mod ieee802154;
2221
mod kernel;
@@ -25,6 +24,7 @@ mod leds;
2524
mod low_level_debug;
2625
mod ninedof;
2726
mod proximity;
27+
mod screen;
2828
mod sound_pressure;
2929
mod syscall_driver;
3030
mod syscalls;
@@ -37,7 +37,6 @@ pub use ambient_light::AmbientLight;
3737
pub use buttons::Buttons;
3838
pub use buzzer::Buzzer;
3939
pub use console::Console;
40-
pub use display::Screen;
4140
pub use gpio::{Gpio, GpioMode, InterruptEdge, PullMode};
4241
pub use ieee802154::Ieee802154Phy;
4342
pub use kernel::Kernel;
@@ -46,6 +45,7 @@ pub use leds::Leds;
4645
pub use low_level_debug::{LowLevelDebug, Message};
4746
pub use ninedof::{NineDof, NineDofData};
4847
pub use proximity::Proximity;
48+
pub use screen::Screen;
4949
pub use sound_pressure::SoundPressure;
5050
pub use syscall_driver::SyscallDriver;
5151
pub use syscalls::Syscalls;
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::fake;
2-
use fake::display::*;
2+
use fake::screen::*;
33
use fake::SyscallDriver;
44
use libtock_platform::share;
55
use libtock_platform::CommandReturn;
@@ -8,7 +8,7 @@ use libtock_platform::Syscalls;
88
// Tests the command implementation.
99
#[test]
1010
fn command() {
11-
let screen = fake::display::Screen::new();
11+
let screen = fake::screen::Screen::new();
1212

1313
// Check if the driver exists
1414
let value = screen.command(EXISTS, 0, 0);
@@ -78,14 +78,14 @@ fn command() {
7878
share::scope(|allow_ro| {
7979
fake::Syscalls::allow_ro::<
8080
DefaultConfig,
81-
{ fake::display::DRIVER_NUM },
82-
{ fake::display::WRITE_BUFFER_ID },
81+
{ fake::screen::DRIVER_NUM },
82+
{ fake::screen::WRITE_BUFFER_ID },
8383
>(allow_ro, &buf)
8484
.unwrap();
8585

8686
// Execute write operation
8787
assert!(
88-
fake::Syscalls::command(fake::display::DRIVER_NUM, fake::display::WRITE, 4, 0)
88+
fake::Syscalls::command(fake::screen::DRIVER_NUM, fake::screen::WRITE, 4, 0)
8989
.is_success()
9090
);
9191
});

0 commit comments

Comments
 (0)