Skip to content

Commit

Permalink
Rename functions
Browse files Browse the repository at this point in the history
  • Loading branch information
avsaase committed Jun 11, 2024
1 parent 4f8508f commit 80e60eb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/rp2040/src/bin/290_bw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async fn main(_spawner: Spawner) {
.unwrap();
string_buf.clear();

driver.update_display(&display).unwrap();
driver.update_from_display(&display).unwrap();

let text_style = TextStyleBuilder::new().alignment(Alignment::Right).build();
loop {
Expand All @@ -82,7 +82,7 @@ async fn main(_spawner: Spawner) {
string_buf.clear();

driver
.quick_partial_update_display(&partial_display_bw, 56, 156)
.quick_partial_update_from_display(&partial_display_bw, 56, 156)
.unwrap();

partial_display_bw.clear(Color::White);
Expand Down
4 changes: 2 additions & 2 deletions examples/stm32g431/src/bin/290_bw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async fn main(_spawner: Spawner) {
.unwrap();
string_buf.clear();

driver.update_display(&display).unwrap();
driver.update_from_display(&display).unwrap();

let text_style = TextStyleBuilder::new().alignment(Alignment::Right).build();
loop {
Expand All @@ -102,7 +102,7 @@ async fn main(_spawner: Spawner) {
string_buf.clear();

driver
.quick_partial_update(partial_display_bw.buffer(), 56, 156, 64, 128)
.quick_partial_update_from_display(&partial_display_bw, 56, 156)
.unwrap();

partial_display_bw.clear(Color::White);
Expand Down
10 changes: 7 additions & 3 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ where
/// Update the screen with the provided [`Display`] using a full refresh.
#[cfg_attr(docsrs, doc(cfg(feature = "graphics")))]
#[cfg(feature = "graphics")]
pub fn update_display<const BUFFER_SIZE: usize>(
pub fn update_from_display<const BUFFER_SIZE: usize>(
&mut self,
display: &Display<WIDTH, HEIGHT, BUFFER_SIZE, crate::color::Color>,
) -> Result<()> {
Expand All @@ -351,7 +351,11 @@ where
/// `x` and the display width `W` must be multiples of 8.
#[cfg_attr(docsrs, doc(cfg(feature = "graphics")))]
#[cfg(feature = "graphics")]
pub fn quick_partial_update_display<const W: u32, const H: u32, const BUFFER_SIZE: usize>(
pub fn quick_partial_update_from_display<
const W: u32,
const H: u32,
const BUFFER_SIZE: usize,
>(
&mut self,
display: &Display<W, H, BUFFER_SIZE, crate::color::Color>,
x: u32,
Expand Down Expand Up @@ -381,7 +385,7 @@ where
/// Update the screen with the provided [`Display`] using a full refresh.
#[cfg_attr(docsrs, doc(cfg(feature = "graphics")))]
#[cfg(feature = "graphics")]
pub fn update_display<const BUFFER_SIZE: usize>(
pub fn update_from_display<const BUFFER_SIZE: usize>(
&mut self,
display: Display<WIDTH, HEIGHT, BUFFER_SIZE, crate::color::TriColor>,
) -> Result<()> {
Expand Down

0 comments on commit 80e60eb

Please sign in to comment.