Skip to content

Commit

Permalink
removing true no_std due to being unusable in stable Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
rudib committed Jan 24, 2022
1 parent 22ab1a3 commit 42d88b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
1 change: 0 additions & 1 deletion finny_nostd_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ publish = false
libc = { version = "0.2", default-features = false }
finny = { path = "../finny/", default-features = false }
heapless = "0.5.6"
jemallocator = "0.3.0"

[profile.dev]
panic = "abort" # disable stack unwinding on panic
Expand Down
25 changes: 3 additions & 22 deletions finny_nostd_tests/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
#![no_std]
#![no_main]

#[alloc_error_handler]
fn default_handler(layout: core::alloc::Layout) -> ! {
panic!("memory allocation of {} bytes failed", layout.size())
}

extern crate jemallocator;

#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
// disabling until no_std + alloc becomes stable
// #![no_std]

use finny::{finny_fsm, FsmFactory, FsmEventQueueArray, inspect::null::InspectNull, FsmTimersNull};
use finny::decl::{FsmBuilder, BuiltFsm};
use heapless::consts::*;

#[no_mangle]
pub extern "C" fn main(_argc: isize, _argv: *const *const u8) -> isize {
pub fn main() {
// Since we are passing a C string the final null character is mandatory
const HELLO: &'static str = "Hello, world!\n\0";
unsafe {
Expand All @@ -31,16 +20,8 @@ pub extern "C" fn main(_argc: isize, _argv: *const *const u8) -> isize {
let mut fsm = StateMachine::new_with(ctx, queue, inspect, timers).unwrap();
fsm.start().unwrap();
}

0
}

#[panic_handler]
fn my_panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}


///////////////////////////////////////////////////

#[derive(Debug, Default)]
Expand Down

0 comments on commit 42d88b6

Please sign in to comment.