Reorganize rust code into crate (for multi-file package)
parent
2058bf9b36
commit
af4e7b5e3d
@ -1 +1,2 @@
|
||||
out/
|
||||
out/
|
||||
rust-funcs/target/
|
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cd /qmk_firmware/
|
||||
rustc -O --emit=obj --target=thumbv7em-none-eabihf --codegen panic=abort -o pomodoro.o ./keyboards/massdrop/alt/keymaps/ashe/pomodoro.rs
|
||||
|
||||
cd /qmk_firmware
|
||||
qmk compile -kb massdrop/alt -km ashe
|
||||
cp massdrop_alt_ashe.bin /out
|
@ -0,0 +1,2 @@
|
||||
[build]
|
||||
target = "thumbv7em-none-eabihf"
|
@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "rust-funcs"
|
||||
version = "0.1.0"
|
@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "rust-funcs"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
[lib]
|
||||
crate-type = ["staticlib"]
|
@ -0,0 +1,15 @@
|
||||
#![no_std]
|
||||
#![no_builtins]
|
||||
#![crate_type = "staticlib"]
|
||||
#![allow(dead_code)]
|
||||
|
||||
mod pomodoro;
|
||||
|
||||
#[panic_handler]
|
||||
fn my_panic(_info: &core::panic::PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,13 +1,3 @@
|
||||
#![no_std]
|
||||
#![no_builtins]
|
||||
#![crate_type = "staticlib"]
|
||||
#![allow(dead_code)]
|
||||
|
||||
#[panic_handler]
|
||||
fn my_panic(_info: &core::panic::PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Copy, Clone)]
|
||||
enum PomState {
|
||||
STOPPED,
|
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cd /rust-funcs
|
||||
cargo build --release
|
||||
cp ./target/thumbv7em-none-eabihf/release/librust_funcs.a /qmk_firmware/
|
||||
|
||||
cd /qmk_firmware
|
||||
qmk compile -kb massdrop/alt -km ashe
|
||||
cp massdrop_alt_ashe.bin /out
|
Loading…
Reference in New Issue