updated to RMK 0.7

This commit is contained in:
Iaphetes 2025-09-14 20:29:45 +02:00
parent 6851a13ae8
commit c147a82941
5 changed files with 941 additions and 205 deletions

View file

@ -6,4 +6,5 @@ runner = "probe-rs run --chip RP2040"
target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+
[env] [env]
DEFMT_LOG = "debug" DEFMT_LOG = "debug"
KEYBOARD_TOML_PATH = { value = "keyboard.toml", relative = true }

886
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -8,60 +8,65 @@ repository = "https://github.com/haobogu/rmk"
readme = "../../README.md" readme = "../../README.md"
edition = "2021" edition = "2021"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
[dependencies] [dependencies]
rmk = { version = "0.6", features = ["split", "rp2040_bl", "rp2040_pio"] } rmk = { version = "0.7", features = ["split", "rp2040_bl", "rp2040_pio"] }
embassy-time = { version = "0.4", features = ["defmt"] } embassy-time = { version = "0.4", features = ["defmt"] }
embassy-rp = { version = "0.4", features = [ embassy-rp = { version = "0.4", features = [
"rp2040", "rp2040",
"defmt", "defmt",
"time-driver", "time-driver",
"critical-section-impl", "critical-section-impl",
] } ] }
embassy-executor = { version = "0.7", features = [ embassy-executor = { version = "0.7", features = [
"defmt", "defmt",
"arch-cortex-m", "arch-cortex-m",
"executor-thread", "executor-thread",
"task-arena-size-32768", ] }
] } embassy-futures = { version = "0.1", features = ["defmt"] }
embassy-futures = { version = "0.1", features = ["defmt"] } cortex-m-rt = "0.7.5"
cortex-m-rt = "0.7.3" portable-atomic = { version = "1.11", features = ["critical-section"] }
portable-atomic = { version = "1.5", features = ["critical-section"] } defmt = "1.0"
defmt = "0.3" defmt-rtt = "1.0"
defmt-rtt = "0.4" panic-probe = { version = "1.0", features = ["print-defmt"] }
panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2"
static_cell = "2"
[patch.crates-io]
# [features] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "f35aa4005a63e8d478b2b95aaa2bfb316b72dece" }
# avoid having to use --allow-multiple-definition linker flag embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "f35aa4005a63e8d478b2b95aaa2bfb316b72dece" }
# on macOS with Apple Silicon at least embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "f35aa4005a63e8d478b2b95aaa2bfb316b72dece" }
# default = ["rp-pico/disable-intrinsics"] sequential-storage = { git = "https://github.com/tweedegolf/sequential-storage", rev = "4e9abcec36c259cb2c30840649ff8f9a6b6fcafc" } # Tmp workaround for https://github.com/tweedegolf/sequential-storage/issues/81
[build-dependencies] # [features]
xz2 = "0.1.7" # avoid having to use --allow-multiple-definition linker flag
json = "0.12" # on macOS with Apple Silicon at least
const-gen = "1.6" # default = ["rp-pico/disable-intrinsics"]
# Split keyboard example [build-dependencies]
[[bin]] xz2 = "0.1.7"
name = "central" json = "0.12"
path = "src/central.rs" const-gen = "1.6"
[[bin]] # Split keyboard example
name = "peripheral" [[bin]]
path = "src/peripheral.rs" name = "central"
path = "src/central.rs"
[profile.dev]
codegen-units = 1 # better optimizations [[bin]]
debug = true name = "peripheral"
opt-level = 1 path = "src/peripheral.rs"
overflow-checks = true
lto = false [profile.dev]
panic = 'unwind' codegen-units = 1 # better optimizations
debug = true
[profile.release] opt-level = 1
codegen-units = 1 # better optimizations overflow-checks = true
debug = true # no overhead for bare-metal lto = false
opt-level = "z" # optimize for binary size panic = 'unwind'
overflow-checks = false
lto = "fat" [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
View 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
View 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!"
'';
};
});
};
}