Skip to content

Commit 68cd958

Browse files
committed
Adjust example
1 parent a2df3a8 commit 68cd958

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# stm32f1-hal
22
Because the design of [stm32f1xx-hal](https://github.com/stm32-rs/stm32f1xx-hal) is unsuitable for my needs and [stm32-hal](https://github.com/David-OConnor/stm32-hal) doesn't support the F1 series, I decided to write a new crate.
3-
43
Many codes come from [stm32f1xx-hal](https://github.com/stm32-rs/stm32f1xx-hal).
54

5+
Example is [here](https://github.com/jw-mcu-rust/stm32f1-hal/blob/main/examples/f103c8/src/main.rs).
6+
67
## Design
78
Below are the design principles.
89
1. Readability is the most important.
@@ -13,3 +14,6 @@ Below are the design principles.
1314
Therefore, if a module is quite complex, I would not use a macro + generic approach, as it is too difficult to read.
1415

1516
Instead, I use a script to generate code for GPIO alternate function remapping and a synchronization script to manage duplicate code across peripherals.
17+
18+
## Note
19+
This project is still in its early stages, with only a few features completed.

examples/f103c8/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
version = "0.1.0"
77

88
[dependencies]
9-
cortex-m = "0.7"
10-
cortex-m-rt = "0.7"
119
[dependencies.stm32f1-hal]
1210
features = ["stm32f103", "x8", "critical-section-single-core"]
1311
path = "../.."

examples/f103c8/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
#![allow(unused_mut)]
66

77
use core::{mem::MaybeUninit, panic::PanicInfo};
8-
use cortex_m::asm;
9-
use cortex_m_rt::entry;
108
use stm32f1_hal as hal;
119
use stm32f1_hal::{
1210
Heap, Mcu,
1311
afio::{NONE_PIN, RemapDefault},
12+
cortex_m::asm,
13+
cortex_m_rt::entry,
1414
embedded_hal::{self, pwm::SetDutyCycle},
1515
embedded_io,
1616
gpio::PinState,

src/common/ringbuf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub use rtrb::{
2-
Consumer, Producer, RingBuffer,
2+
self, Consumer, Producer, RingBuffer,
33
chunks::{ReadChunk, WriteChunkUninit},
44
};
55

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ pub mod uart;
1919

2020
pub use common::ringbuf;
2121
pub use common::simplest_heap::Heap;
22+
pub use cortex_m;
23+
pub use cortex_m_rt;
2224
pub use embedded_hal;
2325
pub use embedded_io;
2426
pub use nb;
25-
pub use rtrb::{self, Consumer, Producer, RingBuffer};
2627
#[cfg(feature = "stm32f100")]
2728
pub use stm32f1::stm32f100 as pac;
2829
#[cfg(feature = "stm32f101")]

0 commit comments

Comments
 (0)