Skip to content

Commit 2bd0405

Browse files
committed
feat: add debug
1 parent b6138cb commit 2bd0405

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

somehal/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keywords.workspace = true
77
license.workspace = true
88
name = "somehal"
99
repository.workspace = true
10-
version = "0.4.2"
10+
version = "0.4.3"
1111

1212
[features]
1313
hv = ["kdef-pgtable/space-low"]

somehal/src/early_debug/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub(crate) fn set_tx_fun(tx: TxFun) {
2525
TX_FUN.init(tx);
2626
}
2727

28-
fn write_byte(b: u8) -> Result<(), TError> {
28+
fn _write_byte(b: u8) -> Result<(), TError> {
2929
TX_FUN(b)
3030
}
3131

@@ -35,7 +35,7 @@ impl core::fmt::Write for TX {
3535
fn write_str(&mut self, s: &str) -> core::fmt::Result {
3636
for b in s.bytes() {
3737
loop {
38-
match write_byte(b) {
38+
match _write_byte(b) {
3939
Ok(_) => break,
4040
Err(TError::ReTry) => continue,
4141
Err(TError::Other) => break,
@@ -58,6 +58,11 @@ pub fn write_fmt(args: core::fmt::Arguments) {
5858
let _ = tx.write_fmt(args);
5959
}
6060

61+
pub fn write_byte(b: u8) -> Result<(), TError> {
62+
let _lock = TX_MUTEX.lock();
63+
_write_byte(b)
64+
}
65+
6166
#[macro_export]
6267
macro_rules! println {
6368
() => {

0 commit comments

Comments
 (0)