embedded systems developers tools, cross compilers
  Home  |   SwiftX Archive  |   SwiftForth Archive  |

Application with two tasks

From: Viviane.Beullens <Viviane.Beullens_at_swing.be>
Date: Wed, 13 Aug 2003 10:46:44 +0200

Hi,

My code was correct. The reason why till yesterday
it flashed at start up was a wrong call in GO.
I thought each task was one way or another to be called in GO
as an activated task. So TASKER SEQBITFLASH was always in GO,
joined in or separated from TASKER BUILD there.
It couldn't but flashing then at start up.

As I may have confused people and as the application
is instructive for working with tasks, I
join again the complete code

\ CODE THAT WORKS OK in combination with
\ : GO /TESTER /TESTER2 DEBUG-LOOP ;
\ /TESTER only builds the task, /TESTER2 halts and starts up the task TESTER

TARGET

|U| |S| |R| BACKGROUND TESTER
|U| |S| |R| BACKGROUND TESTER2

: SEQBITFLASH ( -- ) ACTIVATE
      1
        BEGIN PAUSE
          
          PORTB C@ 2DUP SWAP - AND
          PORTB C! 100 MS 2*
          PORTB C@ 127 = IF DROP 1 CR
                          THEN
           255 PORTB C! 100 MS
         AGAIN ; \ action TESTER

  : READSWITCHES ACTIVATE BEGIN PAUSE
    PIND C@ 254 =
          IF TESTER HALT
              ELSE PIND C@ 253 =
                IF TESTER SEQBITFLASH
                    
                THEN
          THEN
          AGAIN ; \ action TESTER2

: /TESTER ( -- )
    TESTER BUILD ;

: /TESTER2 ( -- )
     $FF DDRB C! \ Set PORTB as OUTPUT
     $FF PORTB C! \ set leds off at start up
   TESTER2 BUILD TESTER2 READSWITCHES ;

Best greetings and thanks for all your patient help,
Viviane
----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe" to swiftx-request_at_forth.com
For list command help, send subject "help" to swiftx-request_at_forth.com
Message archives are located at http://www.forth.com/archive/swiftx
----------------------------------------------------------------------
This list is a forum for SwiftX users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Wed Aug 13 2003 - 01:50:46 PDT

This archive was generated by hypermail 2.2.0 : Fri Dec 05 2008 - 03:04:22 PST