Millisecond Timer Library  v0.85
Millisecond Timer Library for use with Add a Simple Library tutorial.
Functions
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"

Functions

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

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

Function Documentation

int mstime_get ( )

Get milliseconds since call to start.

Returns
Number of milliseconds elapsed.
void mstime_set ( int  newTime)

Set the millisecond timer.

Parameters
newTimeNew millisecond time value that timer should start counting from.
int mstime_start ( )

Start the millisecond timer.

Returns
Nonzero if success, 0 if no cogs available.