with my best grateful.
yes,when I debug my code, It went wrong.
After watching your receive, I try to chek my XS128 register.
some code is doing when pending interrupts is come to “context switching” ,code is follow,
**************************************************************************************************************
#pragma TRAP_PROC
void OSIntCtxSw(void) //中断级任务切换子程序
{
#if OS_CPU_HOOKS_EN > 0
OSTaskSwHook(); /* 4~, Invoke user defined context switch hook */
#endif
__asm{
ldx OSTCBHighRdy ; 3~, OSTCBCur = OSTCBHighRdy
stx OSTCBCur ; 3~
ldab OSPrioHighRdy ; 3~, OSPrioCur = OSPrioHighRdy
stab OSPrioCur ; 3~
ldx OSTCBCur
lds 0,x ;3~, Load SP into 68HC12
pula
staa $15
nop
}
}
***************************************************************************************************************************************
I try to replace it to OSCtxSw(), let PPAGE and stack pointer be saved before switch context,the program run correctly.
So I think there is some wrong when PIT interrupt come,perhaps some registers couldn't be saved correct,When this code
delay is over, program want to execute this part of code from break point, because of the registers' mistaken saved or someting wrong
else when PIT interrupt's coming.
However,I modify my code,let PPAGE and stack point be saved again before switch context , problems seems go away,although I still
do not know why and how it happend.
if its posible could u give me you massage box I send my project to you,
my English is improving, thanks for your help.