Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/// Internal function to implement a variable busy-wait loop.
/// # Arguments
/// * 'count' - an i32, the number of times to cycle the loop.
#[inline(always)]
pub fn delay(count: u32) {
// Our asm busy-wait takes a 16 bit word as an argument,
// so the max number of loops is 2^16
Expand All @@ -49,6 +50,7 @@ pub fn delay(count: u32) {
///delay for N miliseconds
/// # Arguments
/// * 'ms' - an u32, number of milliseconds to busy-wait
#[inline(always)]
pub fn delay_ms(ms: u32) {
// microseconds
let us = ms * 1000;
Expand All @@ -58,6 +60,7 @@ pub fn delay_ms(ms: u32) {
///delay for N microseconds
/// # Arguments
/// * 'ms' - an u32, number of microseconds to busy-wait
#[inline(always)]
pub fn delay_us(us: u32) {
// picoseconds
let ps = us * 1000;
Expand Down