Skip to content

Commit

Permalink
p with api-dio
Browse files Browse the repository at this point in the history
  • Loading branch information
XdoctorwhoZ committed Jul 7, 2024
1 parent 7bc12ae commit b84fec9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
//! new memory settings.

use std::env;
use std::fs;
use std::fs::File;
use std::io::Write;
use std::path::Path;
use std::path::PathBuf;

// use protobuf_codegen;
Expand All @@ -31,5 +33,8 @@ fn main() {
// `memory.x` is changed.
println!("cargo:rerun-if-changed=memory.x");

femtopb_build::compile_protos_into(&["src/api.proto"], &["src"], "src").unwrap();
if !Path::new("src/api_dio.proto").exists() {
femtopb_build::compile_protos_into(&["src/api_dio.proto"], &["src"], "src").unwrap();
fs::rename("src/_.rs", "src/api_dio.rs").unwrap();
}
}
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use bsp::hal::{

use rp_pico::hal::gpio::{FunctionPio0, Pin};

mod api;
mod api_dio;

use serial_line_ip;

Expand All @@ -52,10 +52,10 @@ fn main() -> ! {
let mut watchdog = Watchdog::new(pac.WATCHDOG);
let sio = Sio::new(pac.SIO);

let mes = api::PicohaDioRequest {
r#type: femtopb::EnumValue::Known(api::RequestType::Ping),
let mes = api_dio::PicohaDioRequest {
r#type: femtopb::EnumValue::Known(api_dio::RequestType::Ping),
pin_num: 0,
value: femtopb::EnumValue::Known(api::PinValue::Low),
value: femtopb::EnumValue::Known(api_dio::PinValue::Low),
unknown_fields: Default::default(),
};

Expand Down

0 comments on commit b84fec9

Please sign in to comment.