PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Functions | Variables
mstimer.c File Reference

Code for tracking milliseconds elapsed in another cog. This is part of a tutorial on adding a Simple Library to the project. More...

#include "simpletools.h"
#include "mstimer.h"
+ Include dependency graph for mstimer.c:

Go to the source code of this file.

Functions

void ms_timer (void *par)
 
int mstime_start ()
 Start the millisecond timer. More...
 
void mstime_stop ()
 Stop the millisecond timer and free up a cog.
 
int mstime_get ()
 Get milliseconds since call to start. More...
 
void mstime_reset ()
 Reset the millisecond time elapsed to zero.
 
void mstime_set (int newTime)
 Set the millisecond timer. More...
 

Variables

static volatile int t
 
static volatile int dt
 
static volatile int cog
 
static unsigned int stack [40+25]
 

Detailed Description

Code for tracking milliseconds elapsed in another cog. This is part of a tutorial on adding a Simple Library to the project.

Author
Andy Lindsay

Definition in file mstimer.c.

Function Documentation

◆ mstime_get()

int mstime_get ( )

Get milliseconds since call to start.

Returns
Number of milliseconds elapsed.

Definition at line 36 of file mstimer.c.

◆ mstime_set()

void mstime_set ( int  newTime)

Set the millisecond timer.

Parameters
newTimeNew millisecond time value that timer should start counting from.

Definition at line 46 of file mstimer.c.

◆ mstime_start()

int mstime_start ( )

Start the millisecond timer.

Returns
Nonzero if success, 0 if no cogs available.

Definition at line 21 of file mstimer.c.

+ Here is the call graph for this function: