Skip to content

Commit

Permalink
Run clippy again
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmo14 committed Jun 28, 2020
1 parent 890a057 commit 2a79d71
Show file tree
Hide file tree
Showing 10 changed files with 596 additions and 24 deletions.
147 changes: 131 additions & 16 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "wall_disp"
name = "desktopper"
version = "0.1.0"
authors = ["Jackson <[email protected]>"]
edition = "2018"
Expand All @@ -19,6 +19,11 @@ log = "^0.4"
pretty_env_logger = "^0.4"
signal-hook = {version = "0.1.15", features = ["tokio-support"]}
openssl-sys = "*"
gpio_lcd = {git = "https://github.com/jrmo14/gpio_lcd"}
clap = "2.33.1"
gpio-cdev = "0.3.0"
nix = "0.17.0"
anyhow = "1.0.31"

[features]
vendored = ["openssl-sys/vendored"]
Expand Down
20 changes: 20 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# TODO Change to release
[tasks.build_pi]
description = "Build the project for the raspberry pi"
command = "cargo"
args = ["build", "--target=armv7-unknown-linux-gnueabihf", "--features=vendored"]

[tasks.deploy]
description = "Deploys the project to the raspberry pi"
dependencies = ["build_pi"]
script = [
"echo Creating Zip File",
"zip -r desktopper.zip resources/ target/armv7-unknown-linux-gnueabihf/debug/desktopper target/armv7-unknown-linux-gnueabihf/debug/api_server",
"echo Copying zip file",
"scp desktopper.zip pi@desktopper:~/",
"echo Installing on target",
"ssh pi@desktopper \"unzip desktopper.zip -d desktopper;cd desktopper/resources; chmod +x target_deploy.sh; sudo ./target_deploy.sh; cd ~; rm -rf desktopper*\"",
"echo Cleaning up",
"rm -f desktopper.zip"
]

12 changes: 12 additions & 0 deletions resources/systemd_files/desktopper.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Desktop Task monitor/display

[Service]
# The dummy program will exit
Type=oneshot
ExecStart=/bin/true
# Keep this around after the dummy exits
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions resources/systemd_files/desktopper_display.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Display and interaction controller for Desktopper
PartOf=desktopper.service
After=desktopper.service
After=task_api.service

[Service]
ExecStart=/usr/local/bin/desktopper --rs 14 --enable 15 --data_pins 6 13 19 26 255 255 255 255 -f --cycle_button 17 --mode_button 27 --fn_button_0 22 --fn_button_1 23 --fn_button_2 24
Restart=on-failure

[Install]
WantedBy=desktopper.service

12 changes: 12 additions & 0 deletions resources/systemd_files/task_api.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Webserver hosting task api
PartOf=desktopper.service
After=desktopper.service

[Service]
# Start the component
ExecStart=/usr/local/bin/api_server
Restart=on-failure

[Install]
WantedBy=desktopper.service
7 changes: 7 additions & 0 deletions resources/target_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BIN_DIR=../target/armv7-unknown-linux-gnueabihf/debug
mv systemd_files/* /etc/systemd/system/
mv $BIN_DIR/api_server /usr/local/bin/
mv $BIN_DIR/desktopper /usr/local/bin/
systemctl daemon-reload
systemctl enable desktopper task_api desktopper_display
systemctl start desktopper
6 changes: 3 additions & 3 deletions src/bin/api_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ mod data_model {

use parking_lot::RwLock;

use wall_disp::tasks::ToDo;
use desktopper::tasks::ToDo;

#[derive(Clone)]
pub struct DataStore {
Expand All @@ -69,7 +69,7 @@ mod filters {
use warp::Filter;

use crate::{handlers, DataStore};
use wall_disp::tasks::{Priority, Task};
use desktopper::tasks::{Priority, Task};

pub fn task_master(
storage: DataStore,
Expand Down Expand Up @@ -242,8 +242,8 @@ mod handlers {
use crate::data_model::DataStore;
use crate::SAVE_FILE_PATH;
use chrono::{DateTime, Local};
use desktopper::tasks::{CompletionStatus, EstTime, FlattenTasks, Priority, Task};
use std::ops::Deref;
use wall_disp::tasks::{CompletionStatus, EstTime, FlattenTasks, Priority, Task};

pub async fn add_task(
uuid: Option<Uuid>,
Expand Down
Loading

0 comments on commit 2a79d71

Please sign in to comment.