Skip to content

Commit b9d16cf

Browse files
authored
Use embedded-graphics-core instead of embedded-graphics (#156)
* Switch to embedded-graphics-core for the driver itself * Package upgrades, reformat Cargo.toml * Changelog
1 parent d5e520b commit b9d16cf

File tree

3 files changed

+19
-26
lines changed

3 files changed

+19
-26
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
### Changed
1010

11-
- **(breaking)** [#154](https://github.com/jamwaffles/ssd1306/pull/154) Upgrade to `embedded-graphics` 0.7.
11+
- **(breaking)** [#156](https://github.com/jamwaffles/ssd1306/pull/156) Migrate from `embedded-graphics` to `embedded-graphics-core`.
1212
- **(breaking)** [#150](https://github.com/jamwaffles/ssd1306/pull/150) `BufferedGraphicsMode::set_pixel` now accepts a `bool` instead of a `u8` for the pixel color value.
1313
- **(breaking)** [#150](https://github.com/jamwaffles/ssd1306/pull/150) `display_on` is now called `set_display_on`.
1414
- **(breaking)** [#150](https://github.com/jamwaffles/ssd1306/pull/150) `TerminalMode::get_position` is now called `position` to conform with Rust API guidelines.

Cargo.toml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,29 @@ circle-ci = { repository = "jamwaffles/ssd1306", branch = "master" }
1919
targets = [ "thumbv7m-none-eabi", "thumbv7em-none-eabihf" ]
2020

2121
[dependencies]
22-
embedded-hal = "0.2.3"
23-
display-interface = "0.4"
24-
display-interface-i2c = "0.4"
25-
display-interface-spi = "0.4"
26-
generic-array = "0.14.2"
27-
28-
[dependencies.embedded-graphics]
29-
optional = true
30-
version = "0.7.0"
22+
embedded-hal = "0.2.5"
23+
display-interface = "0.4.1"
24+
display-interface-i2c = "0.4.0"
25+
display-interface-spi = "0.4.1"
26+
generic-array = "0.14.4"
27+
embedded-graphics-core = { version = "0.3.2", optional = true }
3128

3229
[dev-dependencies]
3330
cortex-m = "0.7.2"
34-
cortex-m-rt = "0.6.12"
35-
cortex-m-rtic = "0.5.3"
31+
cortex-m-rt = "0.6.14"
32+
cortex-m-rtic = "0.5.6"
3633
panic-halt = "0.2.0"
3734
cast = { version = "0.2.6", default-features = false }
3835
# Used to load BMP images in various examples
39-
tinybmp = "0.3.0"
40-
36+
tinybmp = "0.3.1"
37+
embedded-graphics = "0.7.1"
4138
# Used by the noise_i2c examples
42-
[dev-dependencies.rand]
43-
version = "0.8.3"
44-
default-features = false
45-
features = [ "small_rng" ]
46-
47-
[dev-dependencies.stm32f1xx-hal]
48-
version = "0.7.0"
49-
features = [ "rt", "stm32f103" ]
39+
rand = { version = "0.8.4", default-features = false, features = [ "small_rng" ] }
40+
stm32f1xx-hal = { version = "0.7.0", features = [ "rt", "stm32f103" ] }
5041

5142
[features]
5243
default = ["graphics"]
53-
graphics = ["embedded-graphics"]
44+
graphics = ["embedded-graphics-core"]
5445

5546
[profile.dev]
5647
codegen-units = 1

src/mode/buffered_graphics.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
use crate::{command::AddrMode, rotation::DisplayRotation, size::DisplaySize, Ssd1306};
44
use display_interface::{DisplayError, WriteOnlyDataCommand};
5-
use embedded_graphics::prelude::Dimensions;
65
use generic_array::GenericArray;
76

87
/// Buffered graphics mode.
@@ -186,8 +185,11 @@ where
186185
}
187186

188187
#[cfg(feature = "graphics")]
189-
use embedded_graphics::{
190-
draw_target::DrawTarget, geometry::OriginDimensions, geometry::Size, pixelcolor::BinaryColor,
188+
use embedded_graphics_core::{
189+
draw_target::DrawTarget,
190+
geometry::Size,
191+
geometry::{Dimensions, OriginDimensions},
192+
pixelcolor::BinaryColor,
191193
Pixel,
192194
};
193195

0 commit comments

Comments
 (0)