Embedded Systems September 2000 Vol13_10

Issue link:

Contents of this Issue


Page 165 of 229

The point where a proper RTOS becomes more of an aid than an impediment is hard to define and depends on the specific system. from the delta queue and simply calls the TMR_PutEvent wi th the ID and paramete r of the expired timer. This inse rts the expired timer into the expired timer ring buf fer. I will leave the fu ll implementa- tio n of the softwa re timer module to the reade r. An exercise in de lta queue coding always proves to be a good brainteaser. There are some interes ting a pects to be taken care of. For example, when th e applica- tion calls TMR_St op, we must make sure that we handle th e removal of the timer from the delta que ue (if the timer is running) or the expired timers ring buffer (if it has expired but the TMR_Process hasn 't pull ed it o ut yet). With all the complexity hidden in the software timer module, the appli- cation code implementing a blinking cursor looks quite simple indeed. See Listing 12. Tidying up The simple and well-known methods described in th is article are sufficient LISTING 12 I I somewhere in the initialization section of the application code TIMER_InstallTimeoutHandlerCTIMER_ID_CURSOR_BLINK, CursorBlink); II start the 330 ms t imer blink around 3 times per second TimerStart CTIME~ID_CURSOR_BLINK, 33, 0); II end of initialization II t his is the actual t imeout handler function II parameter is the next state of t he cursor void CursorBlink

Articles in this issue

Archives of this issue

view archives of EETimes - Embedded Systems September 2000 Vol13_10