Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embedded: Remove error handler #1814

Merged
merged 1 commit into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 0 additions & 12 deletions bitcoin/embedded/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ extern crate bitcoin;

use alloc::string::ToString;
use alloc::vec;
use core::alloc::Layout;
use core::panic::PanicInfo;

use alloc_cortex_m::CortexMHeap;
Expand All @@ -17,7 +16,6 @@ use bitcoin::{Address, Network, PrivateKey};
use bitcoin::secp256k1::ffi::types::AlignedType;
use bitcoin::secp256k1::Secp256k1;

use cortex_m::asm;
use cortex_m_rt::entry;
use cortex_m_semihosting::{debug, hprintln};

Expand Down Expand Up @@ -57,16 +55,6 @@ fn main() -> ! {
loop {}
}

// define what happens in an Out Of Memory (OOM) condition
#[alloc_error_handler]
fn alloc_error(_layout: Layout) -> ! {
hprintln!("alloc error").unwrap();
debug::exit(debug::EXIT_FAILURE);
asm::bkpt();

loop {}
}

#[inline(never)]
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
Expand Down
11 changes: 0 additions & 11 deletions hashes/embedded/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ extern crate bitcoin_hashes;

#[cfg(feature = "alloc")] extern crate alloc;
#[cfg(feature = "alloc")] use alloc_cortex_m::CortexMHeap;
#[cfg(feature = "alloc")] use core::alloc::Layout;
#[cfg(feature = "alloc")] use cortex_m::asm;
#[cfg(feature = "alloc")] use alloc::string::ToString;

use bitcoin_hashes::{sha256, Hash, HashEngine};
Expand Down Expand Up @@ -63,12 +61,3 @@ fn check_result(engine: sha256::HashEngine) {
debug::exit(debug::EXIT_FAILURE);
}
}

// define what happens in an Out Of Memory (OOM) condition
#[cfg(feature = "alloc")]
#[alloc_error_handler]
fn alloc_error(_layout: Layout) -> ! {
asm::bkpt();

loop {}
}