updated to RMK 0.7
This commit is contained in:
parent
6851a13ae8
commit
c147a82941
5 changed files with 941 additions and 205 deletions
|
|
@ -6,4 +6,5 @@ runner = "probe-rs run --chip RP2040"
|
|||
target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+
|
||||
|
||||
[env]
|
||||
DEFMT_LOG = "debug"
|
||||
DEFMT_LOG = "debug"
|
||||
KEYBOARD_TOML_PATH = { value = "keyboard.toml", relative = true }
|
||||
|
|
|
|||
886
Cargo.lock
generated
886
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
119
Cargo.toml
119
Cargo.toml
|
|
@ -8,60 +8,65 @@ repository = "https://github.com/haobogu/rmk"
|
|||
readme = "../../README.md"
|
||||
edition = "2021"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
rmk = { version = "0.6", features = ["split", "rp2040_bl", "rp2040_pio"] }
|
||||
embassy-time = { version = "0.4", features = ["defmt"] }
|
||||
embassy-rp = { version = "0.4", features = [
|
||||
"rp2040",
|
||||
"defmt",
|
||||
"time-driver",
|
||||
"critical-section-impl",
|
||||
] }
|
||||
embassy-executor = { version = "0.7", features = [
|
||||
"defmt",
|
||||
"arch-cortex-m",
|
||||
"executor-thread",
|
||||
"task-arena-size-32768",
|
||||
] }
|
||||
embassy-futures = { version = "0.1", features = ["defmt"] }
|
||||
cortex-m-rt = "0.7.3"
|
||||
portable-atomic = { version = "1.5", features = ["critical-section"] }
|
||||
defmt = "0.3"
|
||||
defmt-rtt = "0.4"
|
||||
panic-probe = { version = "0.3", features = ["print-defmt"] }
|
||||
static_cell = "2"
|
||||
|
||||
# [features]
|
||||
# avoid having to use --allow-multiple-definition linker flag
|
||||
# on macOS with Apple Silicon at least
|
||||
# default = ["rp-pico/disable-intrinsics"]
|
||||
|
||||
[build-dependencies]
|
||||
xz2 = "0.1.7"
|
||||
json = "0.12"
|
||||
const-gen = "1.6"
|
||||
|
||||
# Split keyboard example
|
||||
[[bin]]
|
||||
name = "central"
|
||||
path = "src/central.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "peripheral"
|
||||
path = "src/peripheral.rs"
|
||||
|
||||
[profile.dev]
|
||||
codegen-units = 1 # better optimizations
|
||||
debug = true
|
||||
opt-level = 1
|
||||
overflow-checks = true
|
||||
lto = false
|
||||
panic = 'unwind'
|
||||
|
||||
[profile.release]
|
||||
codegen-units = 1 # better optimizations
|
||||
debug = true # no overhead for bare-metal
|
||||
opt-level = "z" # optimize for binary size
|
||||
overflow-checks = false
|
||||
lto = "fat"
|
||||
|
||||
[dependencies]
|
||||
rmk = { version = "0.7", features = ["split", "rp2040_bl", "rp2040_pio"] }
|
||||
embassy-time = { version = "0.4", features = ["defmt"] }
|
||||
embassy-rp = { version = "0.4", features = [
|
||||
"rp2040",
|
||||
"defmt",
|
||||
"time-driver",
|
||||
"critical-section-impl",
|
||||
] }
|
||||
embassy-executor = { version = "0.7", features = [
|
||||
"defmt",
|
||||
"arch-cortex-m",
|
||||
"executor-thread",
|
||||
] }
|
||||
embassy-futures = { version = "0.1", features = ["defmt"] }
|
||||
cortex-m-rt = "0.7.5"
|
||||
portable-atomic = { version = "1.11", features = ["critical-section"] }
|
||||
defmt = "1.0"
|
||||
defmt-rtt = "1.0"
|
||||
panic-probe = { version = "1.0", features = ["print-defmt"] }
|
||||
static_cell = "2"
|
||||
|
||||
[patch.crates-io]
|
||||
embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "f35aa4005a63e8d478b2b95aaa2bfb316b72dece" }
|
||||
embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "f35aa4005a63e8d478b2b95aaa2bfb316b72dece" }
|
||||
embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "f35aa4005a63e8d478b2b95aaa2bfb316b72dece" }
|
||||
sequential-storage = { git = "https://github.com/tweedegolf/sequential-storage", rev = "4e9abcec36c259cb2c30840649ff8f9a6b6fcafc" } # Tmp workaround for https://github.com/tweedegolf/sequential-storage/issues/81
|
||||
|
||||
# [features]
|
||||
# avoid having to use --allow-multiple-definition linker flag
|
||||
# on macOS with Apple Silicon at least
|
||||
# default = ["rp-pico/disable-intrinsics"]
|
||||
|
||||
[build-dependencies]
|
||||
xz2 = "0.1.7"
|
||||
json = "0.12"
|
||||
const-gen = "1.6"
|
||||
|
||||
# Split keyboard example
|
||||
[[bin]]
|
||||
name = "central"
|
||||
path = "src/central.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "peripheral"
|
||||
path = "src/peripheral.rs"
|
||||
|
||||
[profile.dev]
|
||||
codegen-units = 1 # better optimizations
|
||||
debug = true
|
||||
opt-level = 1
|
||||
overflow-checks = true
|
||||
lto = false
|
||||
panic = 'unwind'
|
||||
|
||||
[profile.release]
|
||||
codegen-units = 1 # better optimizations
|
||||
debug = true # no overhead for bare-metal
|
||||
opt-level = "z" # optimize for binary size
|
||||
overflow-checks = false
|
||||
lto = "fat"
|
||||
|
|
|
|||
62
flake.lock
generated
Normal file
62
flake.lock
generated
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1757745802,
|
||||
"narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1744536153,
|
||||
"narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rust-overlay": "rust-overlay"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1757817311,
|
||||
"narHash": "sha256-ssgd1UHgbYBIWYdHNpiQEahGl2Cpd4Nj54fz9qEV1v0=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "7005365b81bcc335f2b744aa30446f4e575e8dc2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
76
flake.nix
Normal file
76
flake.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
description = "Flake for RMK";
|
||||
|
||||
# Flake inputs
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay"; # A helper for Rust + Nix
|
||||
};
|
||||
|
||||
# Flake outputs
|
||||
outputs = { self, nixpkgs, rust-overlay, ... }:
|
||||
let
|
||||
# Overlays enable you to customize the Nixpkgs attribute set
|
||||
overlays = [
|
||||
# Makes a `rust-bin` attribute available in Nixpkgs
|
||||
(import rust-overlay)
|
||||
# Provides a `rustToolchain` attribute for Nixpkgs that we can use to
|
||||
# create a Rust environment
|
||||
(self: super: {
|
||||
rustToolchain = super.rust-bin.nightly.latest.default;
|
||||
})
|
||||
];
|
||||
|
||||
# Systems supported
|
||||
allSystems = [
|
||||
"x86_64-linux" # 64-bit Intel/AMD Linux
|
||||
"aarch64-linux" # 64-bit ARM Linux
|
||||
];
|
||||
|
||||
# Helper to provide system-specific attributes
|
||||
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
|
||||
pkgs = import nixpkgs { inherit overlays system; };
|
||||
});
|
||||
in
|
||||
{
|
||||
# Development environment output
|
||||
devShells = forAllSystems ({ pkgs }: {
|
||||
default = pkgs.mkShell {
|
||||
# The Nix packages provided in the environment
|
||||
packages = (with pkgs; [
|
||||
# Fluff
|
||||
pkg-config
|
||||
udev
|
||||
clang
|
||||
lld
|
||||
# Rust
|
||||
rustup
|
||||
rustToolchain
|
||||
cargo-make
|
||||
flip-link
|
||||
]) ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [ libiconv ]);
|
||||
shellHook = ''
|
||||
# Required
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath [
|
||||
pkgs.udev
|
||||
pkgs.libxkbcommon
|
||||
pkgs.libllvm
|
||||
pkgs.libdrm
|
||||
pkgs.libelf
|
||||
pkgs.elfutils
|
||||
pkgs.xorg.libxcb
|
||||
pkgs.zstd
|
||||
# If using an intel GPU
|
||||
# If on x11
|
||||
pkgs.xorg.libxshmfence
|
||||
pkgs.xorg.xcbutilkeysyms
|
||||
pkgs.lld
|
||||
]}"
|
||||
# Aliases and other fluff/ease of use
|
||||
alias runIntel="nixVulkanIntel cargo run"
|
||||
echo "Welcome to nix-hell uh nix-shell!"
|
||||
'';
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue