From b34424dde71fb17e8e0abb67cc2001d3a919e7c8 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Tue, 8 Feb 2022 18:56:53 +1000 Subject: [PATCH 1/4] Fix example --- examples/raspberry_pi_inky_phat.rs | 64 +++++++++++------------------- 1 file changed, 23 insertions(+), 41 deletions(-) diff --git a/examples/raspberry_pi_inky_phat.rs b/examples/raspberry_pi_inky_phat.rs index 498357d..6830b1d 100644 --- a/examples/raspberry_pi_inky_phat.rs +++ b/examples/raspberry_pi_inky_phat.rs @@ -10,11 +10,13 @@ use ssd1675::{Builder, Color, Dimensions, Display, GraphicDisplay, Rotation}; // Graphics #[macro_use] extern crate embedded_graphics; +use embedded_graphics::mono_font::MonoTextStyle; use embedded_graphics::prelude::*; +use embedded_graphics::text::Text; // Font extern crate profont; -use profont::{ProFont12Point, ProFont14Point, ProFont24Point, ProFont9Point}; +use profont::{PROFONT_12_POINT, PROFONT_14_POINT, PROFONT_24_POINT, PROFONT_9_POINT}; use std::process::Command; use std::thread::sleep; @@ -116,66 +118,46 @@ fn main() -> Result<(), std::io::Error> { display.clear(Color::White); println!("Clear"); - egtext!( - text = "Raspberry Pi", - top_left = (1, -4), - style = text_style!( - font = ProFont24Point, - background_color = Color::White, - text_color = Color::Red, - ) + Text::new( + "Raspberry Pi", + Point::new(1, -4), + MonoTextStyle::new(&PROFONT_24_POINT, Color::Red), ) .draw(&mut display) .expect("error drawing text"); if let Ok(cpu_temp) = read_cpu_temp() { - egtext!( - text = "CPU Temp:", - top_left = (1, 30), - style = text_style!( - font = ProFont14Point, - background_color = Color::White, - text_color = Color::Black, - ) + Text::new( + "CPU Temp:", + Point::new(1, 30), + MonoTextStyle::new(&PROFONT_14_POINT, Color::Black), ) .draw(&mut display) .expect("error drawing text"); - egtext!( - text = &format!("{:.1}°C", cpu_temp), - top_left = (95, 34), - style = text_style!( - font = ProFont12Point, - background_color = Color::White, - text_color = Color::Black, - ) + Text::new( + &format!("{:.1}°C", cpu_temp), + Point::new(95, 34), + MonoTextStyle::new(&PROFONT_12_POINT, Color::Black), ) .draw(&mut display) .expect("error drawing text"); } if let Some(uptime) = read_uptime() { - egtext!( - text = uptime.trim(), - top_left = (1, 93), - style = text_style!( - font = ProFont9Point, - background_color = Color::White, - text_color = Color::Black, - ) + Text::new( + uptime.trim(), + Point::new(1, 93), + MonoTextStyle::new(&PROFONT_9_POINT, Color::Black), ) .draw(&mut display) .expect("error drawing text"); } if let Some(uname) = read_uname() { - egtext!( - text = uname.trim(), - top_left = (1, 84), - style = text_style!( - font = ProFont9Point, - background_color = Color::White, - text_color = Color::Black, - ) + Text::new( + uname.trim(), + Point::new(1, 84), + MonoTextStyle::new(&PROFONT_9_POINT, Color::Black), ) .draw(&mut display) .expect("error drawing text"); From 77971169f0cd010e4d144b4e4a64247458894605 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Tue, 8 Feb 2022 18:57:21 +1000 Subject: [PATCH 2/4] Version 0.4.0 --- Cargo.toml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2005414..6d4489b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssd1675" -version = "0.3.0" +version = "0.4.0" authors = ["Wesley Moore "] description = "Driver for the SSD1675 e-Paper display (EPD) controller, for use with embedded-hal" @@ -13,10 +13,6 @@ categories = ["embedded", "no-std"] license = "MIT OR Apache-2.0" -[badges] -travis-ci = { repository = "wezm/ssd1675" } -codecov = { repository = "wezm/ssd1675" } - [dependencies] libm = "0.2.2" From 2de56e9a39af99f3c2329d2598b6a9068f45abaa Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Tue, 8 Feb 2022 19:53:13 +1000 Subject: [PATCH 3/4] Replace Travis with Cirrus Travis has just stopped running... and wants me to select a plan to re-enable it. --- .cirrus.yml | 16 ++++++++++++++++ .travis.yml | 25 ------------------------- 2 files changed, 16 insertions(+), 25 deletions(-) create mode 100644 .cirrus.yml delete mode 100644 .travis.yml diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000..46d9ba0 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,16 @@ +test_task: + container: + image: rust:latest + registry_cache: + folder: $CARGO_HOME/registry + fingerprint_script: + - rustc --version + - cat Cargo.toml + install_script: + - apt-get update && apt-get install -y --no-install-recommends binutils-dev cmake libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev python + test_script: + - cargo test + - cargo build --features=examples --examples + coverage_script: + - ci/upload-coverage + before_cache_script: rm -rf $CARGO_HOME/registry/index diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4d5697f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: rust -cache: cargo -script: - - | - cargo test && - cargo build --features=examples --examples - -rust: - - stable - - beta -matrix: - allow_failures: - - rust: beta - -addons: - apt: - packages: - - binutils-dev - - libcurl4-openssl-dev - - zlib1g-dev - - libdw-dev - - libiberty-dev - -after_success: - - ci/upload-coverage From 1f5138aac925cbe81f7b3c09b8c4b199930a8f79 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Tue, 8 Feb 2022 20:08:46 +1000 Subject: [PATCH 4/4] Fix code coverage script --- ci/upload-coverage | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/upload-coverage b/ci/upload-coverage index f24edc6..57ebf9f 100755 --- a/ci/upload-coverage +++ b/ci/upload-coverage @@ -16,9 +16,10 @@ make install DESTDIR=../../kcov-build cd ../.. rm -rf "kcov-$KCOV_VERSION" -for file in target/debug/"$CRATE"-*[^\.d]; do - mkdir -p "target/cov/$(basename "$file")"; - ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename "$file")" "$file"; +for file in target/debug/deps/"$CRATE"-*; do + [ -x "${file}" ] || continue + mkdir -p "target/cov/$(basename "$file")" + ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename "$file")" "$file" done bash <(curl -s https://codecov.io/bash)