Install Rust in docker image, add Rust library and build rules (#41)
* Install Rust in docker image * Also install thumbv7em-none-eabi target * Install Rust in docker image * Also install thumbv7em-none-eabi target * Add Rust example * Link to the Rust example * Call function from the Rust lib * Move PROJECT_DIR to the 'paths' section * Fix target_f1 build * Link to the Rust library in target_f1 * Generate cbindgen bindings * Add forgotten dependency line * Use panic=abort instead of eh_personality lang item * Install Rust in docker image * Also install thumbv7em-none-eabi target * Add Rust example * Link to the Rust example * Call function from the Rust lib * Move PROJECT_DIR to the 'paths' section * Link to the Rust library in target_f1 * Generate cbindgen bindings * Add forgotten dependency line * Use panic=abort instead of eh_personality lang item * add rust call test Co-authored-by: aanper <mail@s3f.ru>
This commit is contained in:
16
core-rs/src/lib.rs
Normal file
16
core-rs/src/lib.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
#![no_std]
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn add(a: u32, b: u32) -> u32 {
|
||||
a + b
|
||||
}
|
||||
|
||||
|
||||
mod aux {
|
||||
use core::panic::PanicInfo;
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(_info: &PanicInfo) -> ! {
|
||||
loop { continue }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user