mirror of
https://github.com/Feliix42/ssd1675.git
synced 2024-11-22 02:46:30 +00:00
commit
bd88bcda65
5 changed files with 44 additions and 74 deletions
16
.cirrus.yml
Normal file
16
.cirrus.yml
Normal file
|
@ -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
|
25
.travis.yml
25
.travis.yml
|
@ -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
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ssd1675"
|
name = "ssd1675"
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
authors = ["Wesley Moore <wes@wezm.net>"]
|
authors = ["Wesley Moore <wes@wezm.net>"]
|
||||||
description = "Driver for the SSD1675 e-Paper display (EPD) controller, for use with embedded-hal"
|
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"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|
||||||
[badges]
|
|
||||||
travis-ci = { repository = "wezm/ssd1675" }
|
|
||||||
codecov = { repository = "wezm/ssd1675" }
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libm = "0.2.2"
|
libm = "0.2.2"
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,10 @@ make install DESTDIR=../../kcov-build
|
||||||
cd ../..
|
cd ../..
|
||||||
rm -rf "kcov-$KCOV_VERSION"
|
rm -rf "kcov-$KCOV_VERSION"
|
||||||
|
|
||||||
for file in target/debug/"$CRATE"-*[^\.d]; do
|
for file in target/debug/deps/"$CRATE"-*; do
|
||||||
mkdir -p "target/cov/$(basename "$file")";
|
[ -x "${file}" ] || continue
|
||||||
./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename "$file")" "$file";
|
mkdir -p "target/cov/$(basename "$file")"
|
||||||
|
./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename "$file")" "$file"
|
||||||
done
|
done
|
||||||
|
|
||||||
bash <(curl -s https://codecov.io/bash)
|
bash <(curl -s https://codecov.io/bash)
|
||||||
|
|
|
@ -10,11 +10,13 @@ use ssd1675::{Builder, Color, Dimensions, Display, GraphicDisplay, Rotation};
|
||||||
// Graphics
|
// Graphics
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate embedded_graphics;
|
extern crate embedded_graphics;
|
||||||
|
use embedded_graphics::mono_font::MonoTextStyle;
|
||||||
use embedded_graphics::prelude::*;
|
use embedded_graphics::prelude::*;
|
||||||
|
use embedded_graphics::text::Text;
|
||||||
|
|
||||||
// Font
|
// Font
|
||||||
extern crate profont;
|
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::process::Command;
|
||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
|
@ -116,66 +118,46 @@ fn main() -> Result<(), std::io::Error> {
|
||||||
display.clear(Color::White);
|
display.clear(Color::White);
|
||||||
println!("Clear");
|
println!("Clear");
|
||||||
|
|
||||||
egtext!(
|
Text::new(
|
||||||
text = "Raspberry Pi",
|
"Raspberry Pi",
|
||||||
top_left = (1, -4),
|
Point::new(1, -4),
|
||||||
style = text_style!(
|
MonoTextStyle::new(&PROFONT_24_POINT, Color::Red),
|
||||||
font = ProFont24Point,
|
|
||||||
background_color = Color::White,
|
|
||||||
text_color = Color::Red,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.draw(&mut display)
|
.draw(&mut display)
|
||||||
.expect("error drawing text");
|
.expect("error drawing text");
|
||||||
|
|
||||||
if let Ok(cpu_temp) = read_cpu_temp() {
|
if let Ok(cpu_temp) = read_cpu_temp() {
|
||||||
egtext!(
|
Text::new(
|
||||||
text = "CPU Temp:",
|
"CPU Temp:",
|
||||||
top_left = (1, 30),
|
Point::new(1, 30),
|
||||||
style = text_style!(
|
MonoTextStyle::new(&PROFONT_14_POINT, Color::Black),
|
||||||
font = ProFont14Point,
|
|
||||||
background_color = Color::White,
|
|
||||||
text_color = Color::Black,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.draw(&mut display)
|
.draw(&mut display)
|
||||||
.expect("error drawing text");
|
.expect("error drawing text");
|
||||||
egtext!(
|
Text::new(
|
||||||
text = &format!("{:.1}°C", cpu_temp),
|
&format!("{:.1}°C", cpu_temp),
|
||||||
top_left = (95, 34),
|
Point::new(95, 34),
|
||||||
style = text_style!(
|
MonoTextStyle::new(&PROFONT_12_POINT, Color::Black),
|
||||||
font = ProFont12Point,
|
|
||||||
background_color = Color::White,
|
|
||||||
text_color = Color::Black,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.draw(&mut display)
|
.draw(&mut display)
|
||||||
.expect("error drawing text");
|
.expect("error drawing text");
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(uptime) = read_uptime() {
|
if let Some(uptime) = read_uptime() {
|
||||||
egtext!(
|
Text::new(
|
||||||
text = uptime.trim(),
|
uptime.trim(),
|
||||||
top_left = (1, 93),
|
Point::new(1, 93),
|
||||||
style = text_style!(
|
MonoTextStyle::new(&PROFONT_9_POINT, Color::Black),
|
||||||
font = ProFont9Point,
|
|
||||||
background_color = Color::White,
|
|
||||||
text_color = Color::Black,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.draw(&mut display)
|
.draw(&mut display)
|
||||||
.expect("error drawing text");
|
.expect("error drawing text");
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(uname) = read_uname() {
|
if let Some(uname) = read_uname() {
|
||||||
egtext!(
|
Text::new(
|
||||||
text = uname.trim(),
|
uname.trim(),
|
||||||
top_left = (1, 84),
|
Point::new(1, 84),
|
||||||
style = text_style!(
|
MonoTextStyle::new(&PROFONT_9_POINT, Color::Black),
|
||||||
font = ProFont9Point,
|
|
||||||
background_color = Color::White,
|
|
||||||
text_color = Color::Black,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.draw(&mut display)
|
.draw(&mut display)
|
||||||
.expect("error drawing text");
|
.expect("error drawing text");
|
||||||
|
|
Loading…
Reference in a new issue