Skip to content

Commit 964a3f3

Browse files
bors[bot]barafaelAfoHT
authored
Merge #36
36: Add stm32f0 hid mouse example for RTIC v1.0 r=AfoHT a=barafael This example was ported from rtic_v0.5/stm32f0_hid_mouse/. It compiles and runs on stm32f072 nucleo. RTT and GPIOs work. Not sure if USB I/O and actual mouse function work - hence draft PR. I'd be glad if somebody could help me test this. Co-authored-by: Rafael Bachmann <rafael.bachmann.93@gmail.com> Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
2 parents 593e5f1 + 77ddcd9 commit 964a3f3

File tree

11 files changed

+935
-6
lines changed

11 files changed

+935
-6
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ updates:
3737
directory: "/rtic_v1/rp-pico_local_initilzd_resources"
3838
schedule:
3939
interval: "weekly"
40+
- package-ecosystem: "cargo"
41+
directory: "/rtic_v1/stm32f0_hid_mouse"
42+
schedule:
43+
interval: "weekly"
4044
- package-ecosystem: "cargo"
4145
directory: "/rtic_v1/stm32f1_bluepill_blinky"
4246
schedule:

rtic_v0.5/stm32f0_hid_mouse/src/main.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#![no_std]
44
#![no_main]
55

6+
use cortex_m::interrupt::free as disable_interrupts;
67
use panic_halt as _;
78
use rtic::app;
89
use rtic::{Exclusive, Mutex};
@@ -18,12 +19,10 @@ use stm32f0xx_hal::{
1819
};
1920

2021
use usb_device::{bus::UsbBusAllocator, prelude::*};
21-
22-
use usbd_hid::descriptor::generator_prelude::*;
23-
use usbd_hid::descriptor::MouseReport;
24-
use usbd_hid::hid_class::HIDClass;
25-
26-
use cortex_m::interrupt::free as disable_interrupts;
22+
use usbd_hid::{
23+
descriptor::{MouseReport, SerializedDescriptor},
24+
hid_class::HIDClass,
25+
};
2726

2827
#[app(device = stm32f0xx_hal::pac, peripherals = true)]
2928
const APP: () = {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[target.thumbv6m-none-eabi]
2+
rustflags = [
3+
"-C", "link-arg=-Tlink.x",
4+
]
5+
6+
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
7+
runner = "probe-run --chip STM32F042G6Ux --defmt"
8+
9+
[build]
10+
target = "thumbv6m-none-eabi"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Refer to https://github.com/probe-rs/cargo-embed/blob/master/src/config/default.toml
2+
# for the comprehensive list of options
3+
4+
[default.general]
5+
chip = "STM32F042G6Ux"
6+
7+
[default.rtt]
8+
enabled = true
9+
show_timestamps = true
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
**/*.rs.bk

0 commit comments

Comments
 (0)