aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar David O'Connor <david.alan.oconnor@gmail.com> 2021-06-12 16:20:01 -0400
committerGravatar David O'Connor <david.alan.oconnor@gmail.com> 2021-06-12 16:20:01 -0400
commitd13ebd2015b7a0326934d75fd04df5a4cba1f0a6 (patch)
tree15ae812c6c1deed88330a3af5081f74fbf5d188d /src
parent1a2b6eaaf65e09688a16e00c4ccd1ad1c9c32a70 (diff)
downloadcortex-m-d13ebd2015b7a0326934d75fd04df5a4cba1f0a6.tar.gz
cortex-m-d13ebd2015b7a0326934d75fd04df5a4cba1f0a6.tar.zst
cortex-m-d13ebd2015b7a0326934d75fd04df5a4cba1f0a6.zip
Use . syntax instead of :: on delay_ms
Diffstat (limited to 'src')
-rw-r--r--src/delay.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/delay.rs b/src/delay.rs
index 17dc654..6f65363 100644
--- a/src/delay.rs
+++ b/src/delay.rs
@@ -29,7 +29,7 @@ impl Delay {
self.syst
}
- /// Delay using the Cortex-M systick for a certain duration, µs.
+ /// Delay using the Cortex-M systick for a certain duration, in µs.
#[inline]
pub fn delay_us(&mut self, us: u32) {
let ticks = (us as u64) * (self.ahb_frequency as u64) / 1_000_000;
@@ -57,15 +57,15 @@ impl Delay {
self.syst.disable_counter();
}
- /// Delay using the Cortex-M systick for a certain duration, ms.
+ /// Delay using the Cortex-M systick for a certain duration, in ms.
#[inline]
pub fn delay_ms(&mut self, mut ms: u32) {
// 4294967 is the highest u32 value which you can multiply by 1000 without overflow
while ms > 4294967 {
- Delay::delay_us(self, 4294967000u32);
+ self.delay_us(4294967000u32);
ms -= 4294967;
}
- Delay::delay_us(self, ms * 1_000);
+ self.delay_us(ms * 1_000);
}
}