Hi All!
Who tried to coding application on c++?
i know that i can use simple C but it very inconveniently for big and serious applications i think.
I tried compiling the cpp application and it successfully compiled and running on module.
But after that i’ve noticed that many ADL and Basic API functions are not adapted for C++,
for exampe Timer:
class A
{
void setTimer();
static void timerCallBack(u8 ID);
void ProcessTimer();
int x,y,z;
}
void
A::setTimer()
{
adl_tmrSubscribe(TRUE /Cycle/, 10 /MSec/, ADL_TMR_TYPE_100MS, (adl_tmrHandler_t) A::timerCallBack)
}
void
A::timerCallBack(u8 ID)
{
ProcessTimer(); //ERROR
x = 10; //ERROR
y = x*z; //ERROR
//we can't do nothing because timerCallBack is STATIC function we haven't pointer for A class;
}
But i’ve made own framework for many functions to additions of additional parameter, etc.
class A
{
void setTimer();
static void timerCallBack(u8 ID, void *User);
void ProcessTimer();
}
void
A::setTimer()
{
adl_tmrSubscribe(TRUE /Cycle/, 10 /MSec/, ADL_TMR_TYPE_100MS, (adl_tmrHandler_t) A::timerCallBack, this)
}
void
A::timerCallBack(u8 ID, void User)
{
A pApp = static_cast<A*>(User);
pApp->ProcessTimer();
pApp->x = 10;
PApp->y = pApp->x*pApp->z;
[b] //works successfully[/b]
}
Maybe i make double work and there are other ways to workaround with C++?
or Wavecom have OpenAT version for C++?
it’s not a problem to make C++ framework with full feature ADL API, but it takes many time for me.
Thanx