From b904a114feafd24474a3b9c48358a7748428acef Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 8 May 2021 16:40:44 +0800 Subject: [PATCH] this commit crashes on boot --- services/shellchat/src/cmds/audio.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/services/shellchat/src/cmds/audio.rs b/services/shellchat/src/cmds/audio.rs index 25dbc10d5..1516b6403 100644 --- a/services/shellchat/src/cmds/audio.rs +++ b/services/shellchat/src/cmds/audio.rs @@ -117,6 +117,21 @@ impl<'a> ShellCmdApi<'a> for Audio { "info" => { write!(ret, "Loaded sample is {}kHz, {} channels, {} format, {} bytes", self.header.sampling_rate, self.header.channel_count, self.header.audio_format, self.raw_len_bytes).unwrap(); } + "dump" => { + let mut temp = String::<9>::new(); + for i in 0..8 { + write!(temp, "{:08x} ", unsafe{self.raw_data.add(i).read_volatile()}).unwrap(); + ret.append(temp.to_str()).unwrap(); + temp.clear(); + } + ret.append("\n").unwrap(); + ret.append("\n").unwrap(); + for i in 0..8 { + write!(temp, "{:08x} ", unsafe{self.raw_data.add(i + 0x2000).read_volatile()}).unwrap(); + ret.append(temp.to_str()).unwrap(); + temp.clear(); + } + } _ => write!(ret, "{}", helpstring).unwrap(), } } else {