File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ version = "0.1.0"
88cortex-m = " 0.7"
99cortex-m-rt = " 0.7"
1010embedded-hal = { version = " 1.0.0" }
11+ critical-section = " 1.2.0"
1112
1213# Debug probe printing
1314defmt = " 0.3"
@@ -18,7 +19,7 @@ panic-probe = { version = "0.3", features = ["print-defmt"] }
1819
1920# Board support package (BSP)
2021rp-pico = " 0.9"
21- embedded-alloc = " 0.5.1 "
22+ embedded-alloc = " 0.6 "
2223
2324# cargo build/run
2425[profile .dev ]
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use alloc::vec::Vec;
88use bsp:: entry;
99use defmt:: info;
1010use defmt_rtt as _;
11- use embedded_alloc:: Heap ;
11+ use embedded_alloc:: LlffHeap as Heap ;
1212use embedded_hal:: digital:: OutputPin ;
1313use panic_probe as _;
1414
@@ -42,8 +42,8 @@ fn main() -> ! {
4242 {
4343 use core:: mem:: MaybeUninit ;
4444 const HEAP_SIZE : usize = 1024 ;
45- static HEAP_MEM : [ MaybeUninit < u8 > ; HEAP_SIZE ] = [ MaybeUninit :: uninit ( ) ; HEAP_SIZE ] ;
46- unsafe { HEAP . init ( HEAP_MEM . as_ptr ( ) as usize , HEAP_SIZE ) }
45+ static mut HEAP_MEM : [ MaybeUninit < u8 > ; HEAP_SIZE ] = [ MaybeUninit :: uninit ( ) ; HEAP_SIZE ] ;
46+ unsafe { HEAP . init ( & raw mut HEAP_MEM as usize , HEAP_SIZE ) }
4747 }
4848
4949 // Peripheral initialization
You can’t perform that action at this time.
0 commit comments