[MAILBOX WIP] disable uart everywhere - WORKS
without uart the thing seems to work fine, so what is wrong?
This commit is contained in:
parent
9d3ee6ab06
commit
d34b214ed0
|
@ -193,11 +193,11 @@ pub mod alpha_mode {
|
||||||
fn write(regs: &RegisterBlock, buf_ptr: u32, channel: u32) -> Result<()> {
|
fn write(regs: &RegisterBlock, buf_ptr: u32, channel: u32) -> Result<()> {
|
||||||
let mut count: u32 = 0;
|
let mut count: u32 = 0;
|
||||||
|
|
||||||
{
|
// {
|
||||||
let mut uart = MiniUart::new();
|
// let mut uart = MiniUart::new();
|
||||||
uart.init();
|
// uart.init();
|
||||||
write!(uart, "Mailbox::write {:x}/{:x}\n", buf_ptr, channel);
|
// write!(uart, "Mailbox::write {:x}/{:x}\n", buf_ptr, channel);
|
||||||
}
|
// }
|
||||||
|
|
||||||
while regs.STATUS.is_set(STATUS::FULL) {
|
while regs.STATUS.is_set(STATUS::FULL) {
|
||||||
count += 1;
|
count += 1;
|
||||||
|
@ -214,8 +214,8 @@ fn write(regs: &RegisterBlock, buf_ptr: u32, channel: u32) -> Result<()> {
|
||||||
fn read(regs: &RegisterBlock, expected: u32, channel: u32) -> Result<()> {
|
fn read(regs: &RegisterBlock, expected: u32, channel: u32) -> Result<()> {
|
||||||
let mut count: u32 = 0;
|
let mut count: u32 = 0;
|
||||||
|
|
||||||
let mut uart = MiniUart::new();
|
// let mut uart = MiniUart::new();
|
||||||
uart.init();
|
// uart.init();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
while regs.STATUS.is_set(STATUS::EMPTY) {
|
while regs.STATUS.is_set(STATUS::EMPTY) {
|
||||||
|
@ -289,20 +289,20 @@ impl Mailbox {
|
||||||
pub fn read(&self, channel: u32) -> Result<()> {
|
pub fn read(&self, channel: u32) -> Result<()> {
|
||||||
read(self, phys2bus(self.buffer.as_ptr() as u32), channel)?;
|
read(self, phys2bus(self.buffer.as_ptr() as u32), channel)?;
|
||||||
|
|
||||||
let mut uart = MiniUart::new();
|
//let mut uart = MiniUart::new();
|
||||||
uart.init();
|
//uart.init();
|
||||||
|
|
||||||
match self.buffer[1] {
|
match self.buffer[1] {
|
||||||
response::SUCCESS => {
|
response::SUCCESS => {
|
||||||
uart.puts("\n######\nMailbox::returning SUCCESS\n");
|
//uart.puts("\n######\nMailbox::returning SUCCESS\n");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
response::ERROR => {
|
response::ERROR => {
|
||||||
uart.puts("\n######\nMailbox::returning ResponseError\n");
|
//uart.puts("\n######\nMailbox::returning ResponseError\n");
|
||||||
Err(MboxError::ResponseError)
|
Err(MboxError::ResponseError)
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
uart.puts("\n######\nMailbox::returning UnknownError\n");
|
//uart.puts("\n######\nMailbox::returning UnknownError\n");
|
||||||
Err(MboxError::UnknownError)
|
Err(MboxError::UnknownError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue