Skip to content

Commit cdd70bb

Browse files
committed
Fix asm::delay not clobbering count register
1 parent b0b0695 commit cdd70bb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Fix `asm::delay()` to ensure count register is always reloaded
13+
1014
## [v0.8.0] - 2022-04-20
1115

1216
### Added

src/asm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ pub unsafe fn delay(cycles: u32) {
8181
"1:",
8282
"addi {0}, {0}, -1",
8383
"bne {0}, zero, 1b",
84-
in(reg) real_cyc
84+
inout(reg) real_cyc => _,
85+
options(nomem, nostack),
8586
)
8687
}
8788

0 commit comments

Comments
 (0)