Skip to content

Commit

Permalink
Merge pull request #2 from purduehackers/cleanup
Browse files Browse the repository at this point in the history
Slight refactor to cleanup network code
  • Loading branch information
ImTheSquid authored Dec 4, 2024
2 parents ec6e2f5 + 46d0d6a commit e54eaaf
Show file tree
Hide file tree
Showing 5 changed files with 353 additions and 522 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sign-firmware"
version = "0.1.2"
version = "0.1.3"
authors = ["Jack Hogan <jackhogan11@gmail.com>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
18 changes: 18 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
// pub mod eeprom;
// pub mod schema;
pub mod net;

use anyhow::anyhow;
use esp_idf_svc::{hal::ledc::LedcDriver, sys::EspError};
use std::net::TcpStream;
use std::os::fd::{AsRawFd, IntoRawFd};

#[macro_export]
macro_rules! anyesp {
($err: expr) => {{
let res = $err;
if res != ::esp_idf_svc::sys::ESP_OK {
Err(::anyhow::anyhow!("Bad exit code {res}"))
} else {
Ok(())
}
}};
}

pub fn convert_error(e: EspError) -> anyhow::Error {
anyhow!("Bad exit code {e}")
}

pub struct Leds {
channels: [LedcDriver<'static>; 15],
}
Expand Down
Loading

0 comments on commit e54eaaf

Please sign in to comment.