Skip to content

Commit

Permalink
feat(example): update stm32h7 example to latest
Browse files Browse the repository at this point in the history
Signed-off-by: Haobo Gu <[email protected]>
  • Loading branch information
HaoboGu committed Feb 5, 2024
1 parent eb6d672 commit e3cae02
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion boards/stm32h7/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU)
# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU)

[env]
DEFMT_LOG = "debug"
DEFMT_LOG = "info"
18 changes: 13 additions & 5 deletions boards/stm32h7/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#![no_main]
#![no_std]

///! NOTE: This example compiles on latest main branch, which may be different from released version
#[macro_use]
mod macros;
mod keymap;
Expand All @@ -21,7 +23,11 @@ use embassy_stm32::{
Config,
};
use panic_probe as _;
use rmk::{initialize_keyboard_with_config_and_run, keyboard::KeyboardUsbConfig, keymap::KeyMap};
use rmk::{
config::{KeyboardAdvancedConfig, KeyboardUsbConfig},
initialize_keyboard_with_config_and_run,
keymap::KeyMap,
};
use static_cell::StaticCell;
use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID};

Expand All @@ -33,9 +39,6 @@ const EEPROM_SIZE: usize = 128;

#[embassy_executor::main]
async fn main(_spawner: Spawner) {
// if cfg!(debug_assertions) {
// rtt_logger::init(log::LevelFilter::Info);
// }
info!("RMK start!");
// RCC config
let mut config = Config::default();
Expand Down Expand Up @@ -108,6 +111,11 @@ async fn main(_spawner: Spawner) {
Some("00000001"),
);

let keyboard_config = KeyboardAdvancedConfig {
usb_config: keyboard_usb_config,
..Default::default()
};

// Start serving
initialize_keyboard_with_config_and_run::<
Driver<'_, USB_OTG_HS>,
Expand All @@ -123,7 +131,7 @@ async fn main(_spawner: Spawner) {
input_pins,
output_pins,
keymap,
keyboard_usb_config,
keyboard_config,
VIAL_KEYBOARD_ID,
VIAL_KEYBOARD_DEF,
)
Expand Down

0 comments on commit e3cae02

Please sign in to comment.