Skip to content

Commit a3ff54b

Browse files
authored
Merge pull request #606 from rust-embedded/c-m-cherrypick
Cherrypick old cortex-m PRs
2 parents 8f347b7 + 523cf3d commit a3ff54b

33 files changed

+226
-89
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
on:
2-
push:
3-
branches-ignore:
4-
- "gh-readonly-queue/**"
52
pull_request:
63
merge_group:
74
workflow_dispatch:

.github/workflows/clippy.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
on:
2-
push:
3-
branches-ignore:
4-
- "gh-readonly-queue/**"
52
pull_request:
63
merge_group:
74
workflow_dispatch:

.github/workflows/on-target.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
on:
2-
push:
3-
branches-ignore:
4-
- "gh-readonly-queue/**"
52
pull_request:
63
merge_group:
74
# allows manual triggering

.github/workflows/rt-ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
on:
2-
push:
3-
branches-ignore:
4-
- "gh-readonly-queue/**"
52
pull_request:
63
merge_group:
74
workflow_dispatch:

.github/workflows/rustfmt.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
on:
2-
push:
3-
branches-ignore:
4-
- "gh-readonly-queue/**"
52
pull_request:
63
merge_group:
74
workflow_dispatch:

cortex-m/Cargo.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ rust-version = "1.61"
1818

1919
[dependencies]
2020
bare-metal = { version = "0.2.4", features = ["const-fn"] }
21-
critical-section = { version = "1.0.0", optional = true }
22-
volatile-register = "0.2.0"
21+
critical-section = "1.0.0"
22+
volatile-register = "0.2.2"
2323
bitfield = "0.13.2"
24-
embedded-hal = "0.2.4"
24+
eh0 = { package = "embedded-hal", version = "0.2.4" }
25+
eh1 = { package = "embedded-hal", version = "1.0.0" }
2526

2627
[dependencies.serde]
2728
version = "1"
@@ -38,7 +39,9 @@ cm7-r0p1 = ["cm7"]
3839
inline-asm = []
3940
linker-plugin-lto = []
4041
std = []
41-
critical-section-single-core = ["critical-section/restore-state-bool"]
42+
critical-section-single-core = ["critical-section/restore-state-u32"]
43+
# Deprecated feature from when critical-section was an optional dependency
44+
critical-section = []
4245

4346
[package.metadata.docs.rs]
4447
targets = [

cortex-m/asm/inline.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ pub unsafe fn __delay(cyc: u32) {
6060
// Add 1 to prevent an integer underflow which would cause a long freeze
6161
let real_cyc = 1 + cyc / 2;
6262
asm!(
63+
// The `bne` on some cores (eg Cortex-M4) will take a different number of instructions
64+
// depending on the alignment of the branch target. Set the alignment of the top of the
65+
// loop to prevent surprising timing changes when the alignment of the delay() changes.
66+
".p2align 3",
6367
// Use local labels to avoid R_ARM_THM_JUMP8 relocations which fail on thumbv6m.
6468
"1:",
6569
"subs {}, #1",

cortex-m/bin/thumbv6m-none-eabi-lto.a

28 Bytes
Binary file not shown.

cortex-m/bin/thumbv6m-none-eabi.a

8 Bytes
Binary file not shown.
24 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)