I need to pass a parameter to a callback function that is going to be called by chVTSet(). However, I couldn't find an example that performs this task.
Basically, I need to pass a boolean pointer to the callback, and for my application global variable can't be used.
Can somebody show me how to do this the right way?
Below is my sample code. I got a warning that states that "passing argument 3 of 'chVTSet' from incompatible pointer type"
Code: Select all
void raiseTimeout(bool *p) {
(*p) = true;
}
void testFunc(void) {
bool is_timeout = false;
virtual_timer_t vt;
chVTReset(&vt);
chVTSet(&vt, MS2ST(200), raiseTimeout, &is_timeout);
}
I'm using ChibiOS 3.0.4, and my application is for STM32F4-Discovery kit.
Thanks!
- Sam