martos 0.4.0

Martos is an elegant real-time operating system designed for creating complex multi-agent systems. Developers have the flexibility to write software for Martos using either Rust (preferred) or C languages.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use core::mem::MaybeUninit;

#[global_allocator]
static ALLOCATOR: esp_alloc::EspHeap = esp_alloc::EspHeap::empty();

/// Heap initialization.
/// For more information see https://github.com/esp-rs/esp-alloc/.
pub fn init_heap() {
    const HEAP_SIZE: usize = 32 * 1024;
    static mut HEAP: MaybeUninit<[u8; HEAP_SIZE]> = MaybeUninit::uninit();

    unsafe {
        ALLOCATOR.init(HEAP.as_mut_ptr() as *mut u8, HEAP_SIZE);
    }
}