reestablishing devenv

This commit is contained in:
Sam Chin 2025-06-06 17:39:59 +08:00
parent 0d0267f0ea
commit b0b29f7d78
3 changed files with 17 additions and 12 deletions

17
Cargo.lock generated
View file

@ -1308,26 +1308,25 @@ dependencies = [
[[package]]
name = "curve25519-dalek"
version = "4.1.2"
source = "git+https://github.com/betrusted-io/curve25519-dalek.git?branch=main#bef542a781348054c32a9beaf6bd1195814cace2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348"
dependencies = [
"cfg-if",
"cpufeatures",
"curve25519-dalek-derive",
"digest 0.10.7",
"engine25519-as",
"fiat-crypto 0.2.7",
"log",
"platforms",
"rustc_version 0.4.0",
"subtle",
"utralib 0.1.25",
"xous 0.9.66 (registry+https://github.com/rust-lang/crates.io-index)",
"zeroize",
]
[[package]]
name = "curve25519-dalek-derive"
version = "0.1.1"
source = "git+https://github.com/betrusted-io/curve25519-dalek.git?branch=main#bef542a781348054c32a9beaf6bd1195814cace2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [
"proc-macro2",
"quote",
@ -4075,6 +4074,12 @@ version = "0.3.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb"
[[package]]
name = "platforms"
version = "3.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b02ffed1bc8c2234bb6f8e760e34613776c5102a041f25330b869a78153a68c"
[[package]]
name = "plotters"
version = "0.3.5"

View file

@ -92,7 +92,7 @@ mod pddb;
#[cfg(feature = "with-pddb")]
use pddb::*;
mod i2cdetect;
use i2cdetect:*;
use i2cdetect::*;
pub struct CmdEnv {
common_env: CommonEnv,
@ -140,7 +140,7 @@ impl CmdEnv {
let mut echo_cmd = Echo {}; // this command has no persistent storage, so we can "create" it every time we call dispatch (but it's a zero-cost absraction so this doesn't actually create any instructions)
let mut ver_cmd = Ver {};
let mut console_cmd = Test {};
let mut i2cdetect_cmd = I2cdetect{};
let mut i2cdetect_cmd = I2cDetect{};
let commands: &mut [&mut dyn ShellCmdApi] = &mut [
///// 4. add your command to this array, so that it can be looked up and dispatched

View file

@ -6,15 +6,15 @@ use crate::{CommonEnv, ShellCmdApi};
pub struct I2cDetect {}
impl<'a> ShellCmdApi<'a> for I2cDetect {
cmd_api!(cui;
cmd_api!(i2cdetect);
fn process(&mut self, args: String, _env: &mut CommonEnv) -> Result<Option<String>, xous::Error> {
use core::fmt::Write;
let mut ret = String::new();
let helpstring = "Usage:
i2cdetect cat - prints cat ascii art
i2cdetect bread - prints bread ascii art
i2cdetect breadcat - prints breadcat ascii art";
i2cdetect cat - prints cat ascii art
i2cdetect bread - prints bread ascii art
i2cdetect breadcat - prints breadcat ascii art";
let mut tokens = args.split_whitespace();