Bluetooth® Sample Application Programmer's Reference
|
Timer processing
Presentation
There can be up to tmrN timers
The first parameter tmr of the functions below is the timer number (0..tmrN-1)
The parameter dly (delay) is the number of centiseconds to wait
Functions | |
int | tmrStart (unsigned char tmr, int dly) |
start the timer tmr for dly centiseconds More... | |
int | tmrGet (unsigned char tmr) |
get the number of centiseconds waitng for timer tmr More... | |
void | tmrStop (unsigned char tmr) |
stop the timer tmr More... | |
Function Documentation
int tmrStart | ( | unsigned char | tmr, |
int | dly | ||
) |
start the timer tmr for dly centiseconds
Start a timer number tmr for dly/100 seconds.
There are 4 timers numbered from 0 to 3.
After starting a timer a function tmrGet() should be called to know whether it is over or not.
The timer should be over after dly/100 seconds.
- Parameters
-
tmr (I) Timer number 0..tmrN-1 dly (I) Initial timer value in hundredth of second
- Returns
- non-negative value if OK; negative otherwise Utilities.h Peripherals.c
int tmrGet | ( | unsigned char | tmr | ) |
get the number of centiseconds waitng for timer tmr
Return the state of the timer tmr.
- Parameters
-
tmr (I) Timer number 0..tmrN-1
- Returns
- negative if failure.
- otherwise the number of centiseconds rest. Utilities.h Peripherals.c
void tmrStop | ( | unsigned char | tmr | ) |
stop the timer tmr
Stop a timer number tmr.
Should be called when the timer is no more needed.
- Parameters
-
tmr (I) Timer number 0..tmrN-1
- Returns
- no Utilities.h Peripherals.c
