Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into update-hardware-in-loop-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Urhengulas committed Jul 27, 2022
2 parents bdf9ef9 + e2b8243 commit c95d08d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## [Unreleased]

- [#334] Simplify snapshot tests
- [#333] Clean up `enum Outcome`
- [#331] Refactor stack painting
- [#330] Fix `fn round_up`
- [#329] Update probe-rs to 0.13.0 (does not yet implement 64-bit support)
Expand All @@ -20,6 +21,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- [#293] Update snapshot tests to new TRACE output

[#334]: https://github.com/knurling-rs/probe-run/pull/334
[#333]: https://github.com/knurling-rs/probe-run/pull/333
[#331]: https://github.com/knurling-rs/probe-run/pull/331
[#330]: https://github.com/knurling-rs/probe-run/pull/330
[#329]: https://github.com/knurling-rs/probe-run/pull/329
Expand Down
21 changes: 7 additions & 14 deletions src/backtrace/mod.rs
Expand Up @@ -92,29 +92,22 @@ pub(crate) enum Outcome {
HardFault,
Ok,
StackOverflow,
CtrlC, // control-c was pressed
/// Control-C was pressed
CtrlC,
}

impl Outcome {
pub(crate) fn log(&self) {
match self {
Outcome::StackOverflow => {
log::error!("the program has overflowed its stack");
}
Outcome::HardFault => {
log::error!("the program panicked");
}
Outcome::Ok => {
log::info!("device halted without error");
}
Outcome::CtrlC => {
log::info!("device halted by user");
}
Outcome::StackOverflow => log::error!("the program has overflowed its stack"),
Outcome::HardFault => log::error!("the program panicked"),
Outcome::Ok => log::info!("device halted without error"),
Outcome::CtrlC => log::info!("device halted by user"),
}
}
}

/// Converts `Outcome` to an exit code.
// Convert `Outcome` to an exit code.
impl From<Outcome> for i32 {
fn from(outcome: Outcome) -> i32 {
match outcome {
Expand Down

0 comments on commit c95d08d

Please sign in to comment.