Remove unused heap allocator
This commit is contained in:
parent
4200a09d09
commit
0f2d455a42
@ -14,4 +14,4 @@ rustflags = [
|
|||||||
target = "xtensa-esp32-none-elf"
|
target = "xtensa-esp32-none-elf"
|
||||||
|
|
||||||
[unstable]
|
[unstable]
|
||||||
build-std = ["alloc", "core"]
|
build-std = ["core"]
|
||||||
|
|||||||
@ -10,6 +10,5 @@ hal = { package = "esp32-hal", version = "0.15.0" }
|
|||||||
esp-backtrace = { version = "0.8.0", features = ["esp32", "panic-handler", "exception-handler", "print-uart"] }
|
esp-backtrace = { version = "0.8.0", features = ["esp32", "panic-handler", "exception-handler", "print-uart"] }
|
||||||
esp-println = { version = "0.6.0", features = ["esp32","log"] }
|
esp-println = { version = "0.6.0", features = ["esp32","log"] }
|
||||||
log = { version = "0.4.18" }
|
log = { version = "0.4.18" }
|
||||||
esp-alloc = { version = "0.3.0" }
|
|
||||||
si5351 = "0.2.0"
|
si5351 = "0.2.0"
|
||||||
embedded-hal = "0.2.7"
|
embedded-hal = "0.2.7"
|
||||||
|
|||||||
14
src/main.rs
14
src/main.rs
@ -1,8 +1,6 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
extern crate alloc;
|
|
||||||
use core::mem::MaybeUninit;
|
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
|
|
||||||
use embedded_hal::serial::Read;
|
use embedded_hal::serial::Read;
|
||||||
@ -19,20 +17,8 @@ use hal::{
|
|||||||
|
|
||||||
use si5351::{Si5351, Si5351Device};
|
use si5351::{Si5351, Si5351Device};
|
||||||
|
|
||||||
#[global_allocator]
|
|
||||||
static ALLOCATOR: esp_alloc::EspHeap = esp_alloc::EspHeap::empty();
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
init_heap();
|
|
||||||
let peripherals = Peripherals::take();
|
let peripherals = Peripherals::take();
|
||||||
//let uart = peripherals.UART0;
|
//let uart = peripherals.UART0;
|
||||||
let mut system = peripherals.DPORT.split();
|
let mut system = peripherals.DPORT.split();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user