PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Utility
libsimpletools
source
pause.c
1
/*
2
* @file pause.c
3
*
4
* @author Andy Lindsay
5
*
6
* @version 1.1.7
7
*
8
* @copyright Copyright (C) Parallax, Inc. 2012. See end of file for
9
* terms of use (MIT License).
10
*
11
* @brief pause function source, see simpletools.h for documentation.
12
*
13
* @detail Please submit bug reports, suggestions, and improvements to
14
* this code to editor@parallax.com.
15
*/
16
17
#include "
simpletools.h
"
// simpletools function prototypes
18
19
void
pause
(
int
time)
// pause function definition
20
{
21
unsigned
int
t =
CNT
;
// Mark time
22
while
(time--)
// Count down pause increments
23
waitcnt
(t +=
st_pauseTicks
);
// Delay one pause increment
24
}
25
26
/*
27
void pause(int time) // pause function definition
28
{ // If st_pauseTicks not initialized, set it up to 1 ms.
29
// if(!st_pauseTicks) set_pause_dt(CLKFREQ/1000);
30
time *= st_pauseTicks; // Calculate system clock ticks
31
waitcnt(time+CNT); // Wait for system clock target
32
}
33
*/
pause
void pause(int time)
Delay cog from moving on to the next statement for a certain length of time.
Definition:
libws2812.c:125
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
st_pauseTicks
int st_pauseTicks
Clock ticks in a time increment used by pause function. Default value is the number of system clock t...
Definition:
timeTicks.c:26
waitcnt
#define waitcnt(a)
Wait until system counter reaches a value.
Definition:
propeller.h:176
CNT
#define CNT
The system clock count.
Definition:
propeller1.h:151
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17