Skip to content

Commit

Permalink
Fixes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
t-moe committed Dec 27, 2023
1 parent 3a43661 commit bbc2436
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]

- [#789]: `defmt`: Add support for new time-related display hints
- [#796]: `panic-probe`: Add `print-log` feature

[#789]: https://github.com/knurling-rs/defmt/pull/789
[#796]: https://github.com/knurling-rs/defmt/pull/796

## defmt-decoder v0.3.9, defmt-print v0.3.10 - 2023-10-04

Expand Down
3 changes: 3 additions & 0 deletions firmware/defmt-test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# [Unreleased]

- [#796] Add support for risc-v

[#796]: https://github.com/knurling-rs/defmt/pull/796

# [v0.3.1]

- [#786]: `defmt-test`: Exit with semihosting exit
Expand Down
4 changes: 1 addition & 3 deletions firmware/defmt-test/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use crate::TestOutcome;
/// Terminates the application and makes a semihosting-capable debug tool exit
/// with status code 0.
pub fn exit() -> ! {
loop {
semihosting::process::exit(0);
}
semihosting::process::exit(0);
}

pub fn check_outcome<T: TestOutcome>(outcome: T, should_error: bool) {
Expand Down
2 changes: 1 addition & 1 deletion firmware/panic-probe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
name = "panic-probe"
readme = "README.md"
repository = "https://github.com/knurling-rs/defmt"
version = "0.4.0"
version = "0.3.1"

[dependencies]
defmt = { version = "0.3", path = "../../defmt", optional = true }
Expand Down
8 changes: 1 addition & 7 deletions firmware/panic-probe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@
[`probe-rs`]: https://github.com/probe-rs/probe-rs

`panic-probe` can optionally log the panic message. Enabled one of the following features for that:
`panic-probe` can optionally log the panic message. Enable one of the following features for that:
* `print-defmt` to print via `defmt::error!(..)`
* `print-log` to print via `log::error!(..)`
* `print-rtt` to print via `rtt_target::rprintln(..)`


using the [`defmt`] logging framework.
This functionality can be enabled through the `print-defmt` Cargo feature.

[`defmt`]: https://github.com/knurling-rs/defmt

## Support

`panic-probe` is part of the [Knurling] project, [Ferrous Systems]' effort at
Expand Down
19 changes: 12 additions & 7 deletions firmware/panic-probe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,21 @@ pub fn abort() -> ! {
semihosting::process::abort();
}

#[cfg(target_os = "none")]
pub fn disable_isr() {
#[cfg(cortex_m)]
#[cfg(target_arch = "riscv32")]
pub fn riscv32_disable_isr() {
unsafe { riscv::interrupt::disable() };
}
#[cfg(target_arch = "riscv32")]
use crate::riscv32_disable_isr as disable_isr;

#[cfg(cortex_m)]
pub fn cortex_m_disable_isr() {
cortex_m::interrupt::disable();
#[cfg(target_arch = "riscv32")]
unsafe {
riscv::interrupt::disable()
};
}

#[cfg(cortex_m)]
use crate::cortex_m_disable_isr as disable_isr;

#[cfg(feature = "print-rtt")]
mod print_rtt {
use core::panic::PanicInfo;
Expand Down

0 comments on commit bbc2436

Please sign in to comment.