Skip to content

Commit

Permalink
Merge branch 'main' into pddb-feat-down
Browse files Browse the repository at this point in the history
  • Loading branch information
bunnie authored Feb 1, 2025
2 parents 3b05282 + 6647cc4 commit 54ba8c9
Show file tree
Hide file tree
Showing 30 changed files with 434 additions and 296 deletions.
10 changes: 5 additions & 5 deletions apps/hello/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ impl Hello {
self.gam
.draw_rectangle(
self.content,
Rectangle::new_with_style(Point::new(0, 0), self.screensize, DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
}),
Rectangle::new_with_style(
Point::new(0, 0),
self.screensize,
DrawStyle { fill_color: Some(PixelColor::Light), stroke_color: None, stroke_width: 0 },
),
)
.expect("can't clear content area");
}
Expand Down
10 changes: 5 additions & 5 deletions apps/hidv2/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ impl HIDv2Demo {
self.gam
.draw_rectangle(
self.content,
Rectangle::new_with_style(Point::new(0, 0), self.screensize, DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
}),
Rectangle::new_with_style(
Point::new(0, 0),
self.screensize,
DrawStyle { fill_color: Some(PixelColor::Light), stroke_color: None, stroke_width: 0 },
),
)
.expect("can't clear content area");
}
Expand Down
10 changes: 5 additions & 5 deletions apps/mtxcli/src/mtxcli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ impl Mtxcli {
self.gam
.draw_rectangle(
self.content,
Rectangle::new_with_style(Point::new(0, 0), self.screensize, DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
}),
Rectangle::new_with_style(
Point::new(0, 0),
self.screensize,
DrawStyle { fill_color: Some(PixelColor::Light), stroke_color: None, stroke_width: 0 },
),
)
.expect("can't clear content area");
}
Expand Down
10 changes: 5 additions & 5 deletions apps/repl/src/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ impl Repl {
self.gam
.draw_rectangle(
self.content,
Rectangle::new_with_style(Point::new(0, 0), self.screensize, DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
}),
Rectangle::new_with_style(
Point::new(0, 0),
self.screensize,
DrawStyle { fill_color: Some(PixelColor::Light), stroke_color: None, stroke_width: 0 },
),
)
.expect("can't clear content area");
}
Expand Down
10 changes: 5 additions & 5 deletions apps/transientdisk/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ impl UI {
self.gam
.draw_rectangle(
self.content,
Rectangle::new_with_style(Point::new(0, 0), self.screensize, DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
}),
Rectangle::new_with_style(
Point::new(0, 0),
self.screensize,
DrawStyle { fill_color: Some(PixelColor::Light), stroke_color: None, stroke_width: 0 },
),
)
.expect("can't clear content area");
}
Expand Down
14 changes: 9 additions & 5 deletions apps/vault/src/prereqs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ pub(crate) fn prereqs(sid: xous::SID, time_conn: xous::CID) -> ([u32; 4], bool)
if allow_redraw {
gam.draw_rectangle(
content,
Rectangle::new_with_style(Point::new(0, 0), screensize, DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
}),
Rectangle::new_with_style(
Point::new(0, 0),
screensize,
DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
},
),
)
.expect("can't clear content area");

Expand Down
81 changes: 50 additions & 31 deletions apps/vault/src/ux/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,15 @@ impl VaultUx {
self.gam
.draw_rectangle(
self.content,
Rectangle::new_with_style(Point::new(0, 0), self.screensize, DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
}),
Rectangle::new_with_style(
Point::new(0, 0),
self.screensize,
DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
},
),
)
.expect("can't clear content area");
self.title_dirty = true; // just blanked the whole area, have to redraw the title.
Expand Down Expand Up @@ -360,11 +364,15 @@ impl VaultUx {
self.gam
.draw_rectangle(
self.content,
Rectangle::new_with_style(tl, br, DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
}),
Rectangle::new_with_style(
tl,
br,
DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
},
),
)
.expect("can't clear content area");
// reset the search
Expand All @@ -379,11 +387,15 @@ impl VaultUx {
self.gam
.draw_rectangle(
self.content,
Rectangle::new_with_style(tl, self.screensize, DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
}),
Rectangle::new_with_style(
tl,
self.screensize,
DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
},
),
)
.expect("can't clear content area");
} else if dirty_tl.is_none() && dirty_br.is_none() {
Expand All @@ -393,11 +405,15 @@ impl VaultUx {
self.gam
.draw_rectangle(
self.content,
Rectangle::new_with_style(Point::new(0, insert_at + 1), self.screensize, DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
}),
Rectangle::new_with_style(
Point::new(0, insert_at + 1),
self.screensize,
DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
},
),
)
.expect("can't clear content area");
}
Expand Down Expand Up @@ -451,18 +467,21 @@ impl VaultUx {
let width = (self.screensize.x - (self.margin.x * 2)) as i32;
let delta_width = (delta * width * 100) / (30 * 100);
self.gam
.draw_rectangle(self.content, Rectangle {
tl: Point::new(self.margin.x, TITLE_HEIGHT - (BAR_HEIGHT + BAR_GAP)),
br: Point::new(
self.screensize.x - self.margin.x - delta_width as i16,
TITLE_HEIGHT - BAR_GAP,
),
style: DrawStyle {
fill_color: Some(PixelColor::Dark),
stroke_color: None,
stroke_width: 0,
.draw_rectangle(
self.content,
Rectangle {
tl: Point::new(self.margin.x, TITLE_HEIGHT - (BAR_HEIGHT + BAR_GAP)),
br: Point::new(
self.screensize.x - self.margin.x - delta_width as i16,
TITLE_HEIGHT - BAR_GAP,
),
style: DrawStyle {
fill_color: Some(PixelColor::Dark),
stroke_color: None,
stroke_width: 0,
},
},
})
)
.ok();
}
self.title_dirty = false;
Expand Down
11 changes: 8 additions & 3 deletions kernel/src/arch/arm/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,14 @@ impl Process {
if sp <= 16 {
return Err(xous_kernel::Error::BadAddress);
}
crate::arch::syscall::invoke(thread, pid == 1, entrypoint, (sp - 16) & !0xf, EXIT_THREAD, &[
setup.arg1, setup.arg2, setup.arg3, setup.arg4,
]);
crate::arch::syscall::invoke(
thread,
pid == 1,
entrypoint,
(sp - 16) & !0xf,
EXIT_THREAD,
&[setup.arg1, setup.arg2, setup.arg3, setup.arg4],
);
Ok(())
}

Expand Down
11 changes: 8 additions & 3 deletions kernel/src/arch/riscv/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,14 @@ impl Process {
*val = 0;
}
thread.sepc = 0;
crate::arch::syscall::invoke(thread, pid == 1, entrypoint, (sp - 16) & !0xf, EXIT_THREAD, &[
setup.arg1, setup.arg2, setup.arg3, setup.arg4,
]);
crate::arch::syscall::invoke(
thread,
pid == 1,
entrypoint,
(sp - 16) & !0xf,
EXIT_THREAD,
&[setup.arg1, setup.arg2, setup.arg3, setup.arg4],
);
Ok(())
}

Expand Down
11 changes: 7 additions & 4 deletions kernel/src/debug/gdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,13 @@ pub fn report_stop(_pid: xous_kernel::PID, tid: xous_kernel::TID, _pc: usize) {
return;
};

let Ok(new_gdb) = inner.report_stop(&mut target, MultiThreadStopReason::SignalWithThread {
signal: Signal::EXC_BREAKPOINT,
tid: Tid::new(tid).unwrap(),
}) else {
let Ok(new_gdb) = inner.report_stop(
&mut target,
MultiThreadStopReason::SignalWithThread {
signal: Signal::EXC_BREAKPOINT,
tid: Tid::new(tid).unwrap(),
},
) else {
println!("Unable to report stop");
return;
};
Expand Down
14 changes: 9 additions & 5 deletions libs/chat/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,15 @@ impl Ui {
self.gam
.draw_rectangle(
self.vp.canvas,
Rectangle::new_with_style(Point::new(0, 0), self.vp.total_screensize, DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
}),
Rectangle::new_with_style(
Point::new(0, 0),
self.vp.total_screensize,
DrawStyle {
fill_color: Some(PixelColor::Light),
stroke_color: None,
stroke_width: 0,
},
),
)
.expect("can't clear canvas area");

Expand Down
9 changes: 4 additions & 5 deletions libs/cramium-hal/src/board/baosec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,10 @@ pub fn setup_kb_pins<T: IoSetup + IoGpio>(iox: &T) -> ([(IoxPort, u8); 3], [(Iox
Some(IoxDriveStrength::Drive2mA),
);
}
([(KB_PORT, R_PINS[0]), (KB_PORT, R_PINS[1]), (KB_PORT, R_PINS[2])], [
(KB_PORT, C_PINS[0]),
(KB_PORT, C_PINS[1]),
(KB_PORT, C_PINS[2]),
])
(
[(KB_PORT, R_PINS[0]), (KB_PORT, R_PINS[1]), (KB_PORT, R_PINS[2])],
[(KB_PORT, C_PINS[0]), (KB_PORT, C_PINS[1]), (KB_PORT, C_PINS[2])],
)
}

pub fn setup_pmic_irq<T: IoIrq>(iox: &T, server: &str, opcode: usize) {
Expand Down
17 changes: 13 additions & 4 deletions libs/cramium-hal/src/udma/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,6 @@ impl<'a> I2c<'a> {
}

pub fn reset(&mut self) {
// reset the block
self.udma_reset(Bank::Custom);
self.udma_reset(Bank::Tx);
self.udma_reset(Bank::Rx);
// reset the block, if MPW. If NTO, this needs to be handled by the upper level code with a
// reset to udma_global
#[cfg(feature = "mpw")]
Expand All @@ -323,6 +319,19 @@ impl<'a> I2c<'a> {
I2cChannel::Channel3 => PeriphId::I2c3,
});
}
for _i in 0..20 {
// dummy read
let _ = self.csr.rf(utra::udma_i2c_0::REG_STATUS_R_BUSY);
}
// reset the block
self.udma_reset(Bank::Custom);
self.udma_reset(Bank::Tx);
self.udma_reset(Bank::Rx);

for _i in 0..20 {
// dummy read
let _ = self.csr.rf(utra::udma_i2c_0::REG_STATUS_R_BUSY);
}

self.send_cmd_list(&[I2cCmd::Config(self.divider)]);
self.pending.take();
Expand Down
Loading

0 comments on commit 54ba8c9

Please sign in to comment.