Counter: setInit(): fix. Init can't be set to lower of down_lim or higher of up_lim
This commit is contained in:
parent
4b1ef018dd
commit
290c73f358
@ -50,7 +50,15 @@ Counter::Counter (unsigned int down, unsigned int up)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Counter::setInit (unsigned int i)
|
Counter::setInit (unsigned int newInit)
|
||||||
{
|
{
|
||||||
init = i;
|
if(newInit > up_lim){
|
||||||
|
init = up_lim;
|
||||||
|
}
|
||||||
|
else if(newInit < down_lim){
|
||||||
|
init = down_lim;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
init = newInit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user