#include "myTestFnAlloc.h"


//Any addresse for signum check:
char const* signum_MyTestFnAlloc = "signum_MyTestFnAlloc";  

void ctor_MyTestFnAlloc(MyTestFnAlloc_s* thiz, float y0)
{
  thiz->signum = signum_MyTestFnAlloc;
  thiz->q1 = y0;  //any initial value
}


void dtor_MyTestFnAlloc(MyTestFnAlloc_s* thiz)
{
  //nothing to do, empty
}


float step_MyTestFnAlloc(MyTestFnAlloc_s* thiz, float u, float k1)
{ if(++thiz->ct1 == 5) { thiz->ct1 = -5; }
  thiz->q1 += k1 * (u - thiz->q1);  
  return thiz->q1;
}


float step2_MyTestFnAlloc(MyTestFnAlloc_s* thiz, float k1)
{ 
  thiz->ct2 = thiz->ct1;
  thiz->q2 += k1 * (thiz->q1 - thiz->q2);  
  return thiz->q2;
}



