In the process of trying to transplant μc/Os onto the ARM7 chip (LPC2138), it was found that OSTMR created with Ostmrcreate was never able to execute Callbackfunction,os version v2.85, and finally resolved.
A description of the function "Ostmrsignal ()" was found in the document "Ucos-ii-refman.pdf":
Ostmrsignal () is called either by a task or an ISR to indicate that it's time to update the timers. Typically, ostmrsignal () would is called by Ostimetickhook () at a multiple of the tick rate.
It indicates the need to call "ostmrsignal ()" To update the timer. So you probably know where the problem is, and here's an example from the documentation:
#if Os_tmr_en > 0static0; #endif void Ostimetickhook (void) {#if os_tmr_en > 0 ostmrtickctr+ +; if (Ostmrtickctr >= (os_ticks_per_sec/0; Ostmrsignal ();} #endif }
So modify the hook function, add the above code, I am not quite sure where the new static local variables are more appropriate, so it is also placed in the hook function, this way:
/*********************************************************************************************************** TICK hook** description:this function is called every tick.** arguments:none** Note (s): 1) interrupts may or May is is ENABLED during this call.******************************************************** **************************************************/#if(Os_cpu_hooks_en > 0) && (os_time_tick_hook_en > 0)voidOstimetickhook (void){#ifOs_tmr_en > 0Staticint16u ostmrtickctr =0; #endif #ifOs_tmr_en > 0ostmrtickctr++; if(Ostmrtickctr >= (os_ticks_per_sec/os_tmr_cfg_ticks_per_sec)) {ostmrtickctr=0; Ostmrsignal (); }#endif}#endif
Finally in the Proteus inside verify pass.
Before the use of ΜC/OS-III software timer, directly with it, it seems that do not need to do so ah.
I feel the transplant operating system is too difficult for me, OK, not a transplant, just rewrite the BSP!
Using software timers in μc/Os