mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
improve error messages
This commit is contained in:
parent
2f957d3f35
commit
e770249f0a
2 changed files with 5 additions and 5 deletions
|
|
@ -11,4 +11,4 @@ pub mod irq;
|
||||||
#[cfg(feature = "bao1x-usb")]
|
#[cfg(feature = "bao1x-usb")]
|
||||||
pub mod usb;
|
pub mod usb;
|
||||||
|
|
||||||
pub const UART_BAUD: u32 = 1_000_000;
|
pub const UART_BAUD: u32 = bao1x_api::UART_BAUD;
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ impl Repl {
|
||||||
"peek" => {
|
"peek" => {
|
||||||
if args.len() == 1 || args.len() == 2 {
|
if args.len() == 1 || args.len() == 2 {
|
||||||
let addr = usize::from_str_radix(&args[0], 16)
|
let addr = usize::from_str_radix(&args[0], 16)
|
||||||
.map_err(|_| Error::help("Peek address is in hex"))?;
|
.map_err(|_| Error::help("Peek address is in hex, no leading 0x"))?;
|
||||||
|
|
||||||
let count = if args.len() == 2 {
|
let count = if args.len() == 2 {
|
||||||
if let Ok(count) = u32::from_str_radix(&args[1], 10) { count } else { 1 }
|
if let Ok(count) = u32::from_str_radix(&args[1], 10) { count } else { 1 }
|
||||||
|
|
@ -146,10 +146,10 @@ impl Repl {
|
||||||
"poke" => {
|
"poke" => {
|
||||||
if args.len() == 2 || args.len() == 3 {
|
if args.len() == 2 || args.len() == 3 {
|
||||||
let addr = u32::from_str_radix(&args[0], 16)
|
let addr = u32::from_str_radix(&args[0], 16)
|
||||||
.map_err(|_| Error::help("Poke address is in hex"))?;
|
.map_err(|_| Error::help("Poke address is in hex, no leading 0x"))?;
|
||||||
|
|
||||||
let value =
|
let value = u32::from_str_radix(&args[1], 16)
|
||||||
u32::from_str_radix(&args[1], 16).map_err(|_| Error::help("Poke value is in hex"))?;
|
.map_err(|_| Error::help("Poke value is in hex, no leading 0x"))?;
|
||||||
let count = if args.len() == 3 {
|
let count = if args.len() == 3 {
|
||||||
if let Ok(count) = u32::from_str_radix(&args[2], 10) { count } else { 1 }
|
if let Ok(count) = u32::from_str_radix(&args[2], 10) { count } else { 1 }
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue