AVRMega can't switch two threads
Re: AVRMega can't switch two threads
Now, I detect when program execute function chVTResetI(). After execute that my program will auto reset and run again from start of main function.
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: AVRMega can't switch two threads
Without seeing your code it is hard to give meaningful advice. Has the virtual timer been initialized?
Giovanni
Giovanni
Re: AVRMega can't switch two threads
Yes, I initialized virtual timer already.
When my program execute last instruction (return value) of funnction chSchGoSleepTimeoutS(), then my program will exit this function and reset itself.
I try many times for checking it.
Code: Select all
msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) {
chDbgCheckClassS();
if (TIME_INFINITE != time) {
VirtualTimer vt;
chVTSetI(&vt, time, wakeup, currp);
chSchGoSleepS(newstate);
if (chVTIsArmedI(&vt))
chVTResetI(&vt);
}
else
chSchGoSleepS(newstate);
return currp->p_u.rdymsg; << After execute this instruction
}
When my program execute last instruction (return value) of funnction chSchGoSleepTimeoutS(), then my program will exit this function and reset itself.
I try many times for checking it.
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: AVRMega can't switch two threads
Does "currp" contain a meaningful value? (it should be pointing to the current thread).
Without more context I can't help.
Giovanni
Without more context I can't help.
Giovanni
Re: AVRMega can't switch two threads
https://www.dropbox.com/s/jql248qve6he8xq/test01.rar
Above link is my source code that I use to debugging.
Above link is my source code that I use to debugging.
Who is online
Users browsing this forum: No registered users and 8 guests