Skip to content

Commit

Permalink
fix: fix project config and documentations
Browse files Browse the repository at this point in the history
Signed-off-by: Haobo Gu <[email protected]>
  • Loading branch information
HaoboGu committed Jan 21, 2024
1 parent 1f5f465 commit f7b7043
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"--message-format=json"
],
"rust-analyzer.linkedProjects": [
"./rmk/Cargo.toml"
"rmk/Cargo.toml"
],
"rust-analyzer.showUnlinkedFileNotification": false,
}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ members = [
"boards/rp2040",
# Uncomment to choose one chip you want to use
"boards/stm32h7",
#"boards/stm32f4"
# "boards/stm32f4"
]
default-members = ["boards/stm32h7", "rmk"]

Expand Down
2 changes: 2 additions & 0 deletions boards/stm32f4/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ panic-probe = {version = "0.3", features = ["print-defmt"] }
name = "rmk-stm32f4"
test = false
bench = false

[workspace]
22 changes: 12 additions & 10 deletions rmk/src/layout_macro.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
/// Macro for creating layout of actions
/// Create a layer in keymap
#[macro_export]
macro_rules! layer {
([$([$($x: expr), +]), +]) => {
[$([$($x), +]),+]
};
}

/// Create a normal keycode
#[macro_export]
macro_rules! k {
($k: ident) => {
$crate::action::KeyAction::Single($crate::action::Action::Key($crate::keycode::KeyCode::$k))
};
}

/// Create a normal action
#[macro_export]
macro_rules! a {
($a: ident) => {
$crate::action::KeyAction::$a
};
}

/// Macro for mouse key action
/// Create a mouse key action
#[macro_export]
macro_rules! mk {
($k: ident) => {
Expand All @@ -30,7 +32,7 @@ macro_rules! mk {
};
}

/// Macro for system control action
/// Create a control action
#[macro_export]
macro_rules! sc {
($k: ident) => {
Expand All @@ -40,7 +42,7 @@ macro_rules! sc {
};
}

/// Macro for consumer control action
/// Create a consumer control action
#[macro_export]
macro_rules! cc {
($k: ident) => {
Expand All @@ -50,23 +52,23 @@ macro_rules! cc {
};
}

/// Macro for layer activate
/// Create a layer activate action
#[macro_export]
macro_rules! mo {
($x: literal) => {
$crate::action::KeyAction::Single($crate::action::Action::LayerOn($x))
};
}

/// Macro for layer activate with modifier
/// Create a layer activate with modifier action
#[macro_export]
macro_rules! lm {
($x: literal, $m: expr) => {
$crate::action::KeyAction::WithModifier($crate::action::Action::LayerOn($x), $m)
};
}

/// Macro for layer or tap key
/// Create a layer activate action or tap key(tap/hold)
#[macro_export]
macro_rules! lt {
($x: literal, $k: ident) => {
Expand All @@ -77,23 +79,23 @@ macro_rules! lt {
};
}

/// Macro for oneshot layer
/// Create an oneshot layer key in keymap
#[macro_export]
macro_rules! osl {
($x: literal) => {
$crate::action::KeyAction::OneShot($crate::action::Action::LayerOn($x))
};
}

/// Macro for layer toggle
/// Create a layer toggle action
#[macro_export]
macro_rules! tg {
($x: literal) => {
$crate::action::KeyAction::Single($crate::action::Action::LayerToggle($x))
};
}

/// Macro for layer or tap toggle
/// Create a layer activate or tap toggle action
#[macro_export]
macro_rules! tt {
($x: literal) => {
Expand Down
3 changes: 1 addition & 2 deletions rmk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ use embedded_storage::nor_flash::NorFlash;
use keyboard::Keyboard;
use keymap::KeyMap;
use usb::KeyboardUsbDevice;
use via::process::VialService;

pub use embassy_sync;
pub use embassy_usb;
pub use usbd_hid;
use via::process::VialService;

pub mod action;
pub mod debounce;
Expand Down

0 comments on commit f7b7043

Please sign in to comment.