You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
362 B
32 lines
362 B
//
|
|
// counter.c
|
|
//
|
|
// implements an up/down-Counter
|
|
//
|
|
// (C) R. Bonderer, HSR Hochschule Rapperswil, Okt. 2019
|
|
//
|
|
|
|
#include "counter.h"
|
|
|
|
static int countValue;
|
|
|
|
void cnt_init(int val)
|
|
{
|
|
countValue = val;
|
|
}
|
|
|
|
void cnt_count(int step)
|
|
{
|
|
countValue += step;
|
|
}
|
|
|
|
int cnt_getCounter()
|
|
{
|
|
return countValue;
|
|
}
|
|
|
|
void cnt_setCounter(int val)
|
|
{
|
|
countValue = val;
|
|
}
|