Skip to content

Commit

Permalink
refactor: reformat code
Browse files Browse the repository at this point in the history
Signed-off-by: Haobo Gu <[email protected]>
  • Loading branch information
HaoboGu committed Feb 18, 2024
1 parent e1071bd commit 3ca6dd6
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 20 deletions.
5 changes: 2 additions & 3 deletions boards/nrf52840/memory.x
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ MEMORY
RAM : ORIGIN = 0x20000000, LENGTH = 256K

/* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */
/* FLASH : ORIGIN = 0x00027000, LENGTH = 868K
RAM : ORIGIN = 0x20020000, LENGTH = 128K */

/* FLASH : ORIGIN = 0x00027000, LENGTH = 868K
RAM : ORIGIN = 0x20020000, LENGTH = 128K */
}
1 change: 0 additions & 1 deletion boards/nrf52840/src/vial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ include!(concat!(env!("OUT_DIR"), "/config_generated.rs"));
// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00,
// 0x00, 0x04, 0x59, 0x5A,
// ];

1 change: 0 additions & 1 deletion boards/rp2040/src/keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ pub static KEYMAP: [[[KeyAction; COL]; ROW]; NUM_LAYER] = [
[mo!(1), a!(No), k!(Kp0)]
]),
];

2 changes: 1 addition & 1 deletion boards/rp2040/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ macro_rules! config_matrix_pins_rp {
(input_pins, output_pins)
}
};
}
}
6 changes: 5 additions & 1 deletion boards/rp2040/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ use embassy_rp::{
usb::{Driver, InterruptHandler},
};
use panic_probe as _;
use rmk::{config::{RmkConfig, KeyboardUsbConfig, VialConfig}, initialize_keyboard_with_config_and_run, keymap::KeyMap};
use rmk::{
config::{KeyboardUsbConfig, RmkConfig, VialConfig},
initialize_keyboard_with_config_and_run,
keymap::KeyMap,
};
use static_cell::StaticCell;
use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID};

Expand Down
1 change: 0 additions & 1 deletion boards/rp2040/src/vial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ include!(concat!(env!("OUT_DIR"), "/config_generated.rs"));
// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00,
// 0x00, 0x04, 0x59, 0x5A,
// ];

2 changes: 1 addition & 1 deletion boards/stm32f4/src/vial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ pub const VIAL_KEYBOARD_DEF: [u8; 308] = [
0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02,
0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00,
0x00, 0x04, 0x59, 0x5A,
];
];
2 changes: 1 addition & 1 deletion boards/stm32h7/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use embassy_stm32::{
};
use panic_probe as _;
use rmk::{
config::{RmkConfig, KeyboardUsbConfig, VialConfig},
config::{KeyboardUsbConfig, RmkConfig, VialConfig},
initialize_keyboard_with_config_and_run,
keymap::KeyMap,
};
Expand Down
1 change: 0 additions & 1 deletion boards/stm32h7/src/vial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ include!(concat!(env!("OUT_DIR"), "/config_generated.rs"));
// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00,
// 0x00, 0x04, 0x59, 0x5A,
// ];

8 changes: 4 additions & 4 deletions rmk/src/keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ pub(crate) struct KeyMapConfig {
}

/// Keymap represents the stack of layers.
///
///
/// The conception of Keymap in rmk is borrowed from qmk: <https://docs.qmk.fm/#/keymap>.
///
///
/// Keymap should be binded to the actual pcb matrix definition.
/// RMK detects hardware key strokes, uses tuple `(row, col, layer)` to retrieve the action from Keymap.
pub struct KeyMap<
Expand Down Expand Up @@ -53,9 +53,9 @@ impl<
> KeyMap<F, EEPROM_SIZE, ROW, COL, NUM_LAYER>
{
/// Initialize a keymap from a matrix of actions
///
///
/// # Arguments
///
///
/// * `action_map` - [KeyAction] matrix defined in keymap
/// * `storage` - backend storage for eeprom, used for saving keyboard data persistently
/// * `eeconfig` - keyboard configurations which should be stored in eeprom
Expand Down
10 changes: 5 additions & 5 deletions rmk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Enable std in test
#![cfg_attr(not(test), no_std)]

use config::{RmkConfig, KeyboardUsbConfig, VialConfig};
use config::{KeyboardUsbConfig, RmkConfig, VialConfig};
use core::{cell::RefCell, convert::Infallible};
use defmt::{error, info};
use embassy_futures::join::join;
Expand Down Expand Up @@ -62,9 +62,9 @@ pub(crate) fn initialize_keyboard_and_usb_device<
}

/// Initialize and run the keyboard service, with given keyboard usb config. This function never returns.
///
///
/// # Arguments
///
///
/// * `driver` - embassy usb driver instance
/// * `input_pins` - input gpio pins
/// * `output_pins` - output gpio pins
Expand Down Expand Up @@ -138,9 +138,9 @@ pub async fn initialize_keyboard_with_config_and_run<
}

/// Initialize and run the keyboard service, this function never returns.
///
///
/// # Arguments
///
///
/// * `driver` - embassy usb driver instance
/// * `input_pins` - input gpio pins
/// * `output_pins` - output gpio pins
Expand Down

0 comments on commit 3ca6dd6

Please sign in to comment.