From e8f5f0038693b5cdc0ceabd0f552d533822934d7 Mon Sep 17 00:00:00 2001 From: Felix Suchert Date: Tue, 6 Jun 2023 19:52:26 +0200 Subject: [PATCH] bump update time to 5 minutes --- Cross.toml | 1 + src/bin/inky.rs | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cross.toml b/Cross.toml index a7772be..9264c98 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,2 +1,3 @@ [target.arm-unknown-linux-gnueabihf] +pre-build = ["dpkg --add-architecture armhf && apt-get update && apt-get install --assume-yes libssl-dev:armhf"] image = "rustcross/arm-unknown-linux-gnueabihf" diff --git a/src/bin/inky.rs b/src/bin/inky.rs index 78d6090..f227103 100644 --- a/src/bin/inky.rs +++ b/src/bin/inky.rs @@ -1,13 +1,12 @@ -use embedded_graphics::{mono_font::MonoTextStyle, prelude::*, text::Text}; use linux_embedded_hal::{ spidev::{SpiModeFlags, SpidevOptions}, sysfs_gpio::Direction, Delay, Pin, Spidev, }; -use profont::{PROFONT_12_POINT, PROFONT_14_POINT, PROFONT_24_POINT, PROFONT_9_POINT}; use ssd1675::{Builder, Color, Dimensions, Display, GraphicDisplay, Rotation}; use std::thread::sleep; use std::time::Duration; +use inky_ticker::ApplicationState; // Activate SPI, GPIO in raspi-config needs to be run with sudo because of some sysfs_gpio // permission problems and follow-up timing problems @@ -89,7 +88,7 @@ fn main() -> Result<(), std::io::Error> { let mut display = GraphicDisplay::new(display, &mut black_buffer, &mut red_buffer); let mut state = ApplicationState::default(); - let one_minute = Duration::from_secs(60); + let five_minutes = Duration::from_secs(300); // Main loop. updates the screen after a fixed time interval with the next screen loop { @@ -107,6 +106,6 @@ fn main() -> Result<(), std::io::Error> { println!("Finished - going to sleep"); display.deep_sleep()?; - sleep(one_minute); + sleep(five_minutes); } }