ARM RTOS help required urgent

hello friends
i have written the code for ARM RTOS, i have used same priority for all of my 4 task, its working fine

my problem is when i change the priority in the code then all task's are not executing simultaneously....
please any one help

Parents Reply
  • per,
    i am sorry.........
    i m not understanding this

    www.keil.com/.../rlarm_os_evt_wait_or.htm

    function................

    i have the example code . i am not able to understand please help
    example code:

    /************************************************************/
    /* PROJECT NAME: Events                                         */
    /* Project:      Introduction to RL-ARM                     */
    /* Engineer:     T Martin        tmartin@hitex.co.uk        */
    /* Filename:     main.c                                     */
    /* Language:     C                                              */
    /* Compiler:     Real View 3.4                                      */
    /* Assembler:                                                               */
    /* O/S:                 RL-ARM 3.4                                  */
    /************************************************************/
    /* COPYRIGHT: Hitex UK Ltd              2007                                            */
    /* LICENSE:   THIS VERSION CREATED FOR FREE DISTRIBUTION        */
    /************************************************************/
    /* Function:                                                */
    /*                                                          */
    /* Example                                                                                              */
    /*                                                                                                                      */
    /* Demonstrates the handeling of event flags in RTL RTOS        */
    /*                                                                                                                      */
    /* Oscillator frequency 12.000 Mhz                                                      */
    /* Target board Keil MCB23000                                                           */
    /************************************************************/
    
    
    #include <rtl.h>
    #include <LPC23xx.H>
    #include "LCD.h"
    void LED_Init(void);
    void LED_On (unsigned int num);
    void LED_Off (unsigned int num);
    
    void task1 (void);                                                                              // Function prototypes for tasks
    void task2 (void);
    void task3 (void);
    void task4 (void);
    
    OS_TID tsk1,tsk2,tsk3,tsk4;                                                             //Define Task-ID variables
    
    int main (void)
    {
    
    LED_Init();
    lcd_init();                                                                                             //Setup the LCD display
    lcd_clear();
    lcd_print ("  Event  ");
    
    os_sys_init (task1);                                                                    //Start the RTX with task1
    }
    
    
    __task void task1 (void)                                                                                //define function as task
    {
    
    tsk1            = os_tsk_self();                                                        //Get Task 1 Handle
    tsk2            = os_tsk_create(task2,1);                                       //create tasks
    tsk3            = os_tsk_create(task3,1);
    tsk4            = os_tsk_create(task4,1);
    
    while(1)
    {
    
    os_evt_wait_or(0x0005,0xffff);                                                  //Wait for an event to be set, no time out
    
    set_cursor (0, 1);                                                                              //Print running task to LCD
    lcd_print ("  Task 1      ");
    
    LED_On(0x01);                                                                                   //Switch on an LED to how the task has run
    os_dly_wait(50);
    os_evt_set(0x0001,tsk2);                                                                //Set an event for task 2. Each task has 16 event flags
    os_evt_set(0x0001,tsk3);                                                                //Set an event in task 3
    
    }
    }
    
    __task void task2 (void)
    {
    while(1)
    {
    os_evt_wait_or(0x0001,0xffff);                                                  //Wait for an event
    set_cursor (0, 1);                                                                              //Print running task to LCD
    lcd_print ("  Task 2      ");
    
    LED_On(0x02);                                                                                   //Switch on an LED to how the task has run
    os_dly_wait(50);
    os_evt_set(0x0002,tsk3);                                                                //Set an event in Task 3
    
    
    }
    }
    
    __task void task3 (void)
    {
    
    while(1)
    {
    
    os_evt_wait_and(0x0003,0xffff);                                                 // Wait for two event flags to be set
    set_cursor (0, 1);                                                                              //Print running task to LCD
    lcd_print ("  Task 3      ");
    
    LED_On(0x04);                                                                                   //Switch on an LED to how the task has run
    os_dly_wait(50);
    LED_Off(0x07);                                                                                  //Clear the led's
    os_dly_wait(100);                                                                               //Delay
    
    os_evt_set(0x0001,tsk1);                                                                //Trigger task 1 to start over
    
    
    }
    }
    
    __task void task4 (void)
    {
    os_evt_set(0x0001,tsk1);                                                                //Set an event in task 1 to kick off with
    os_tsk_delete_self();                                                                   //Delete the task
    }
    
     void LED_Init(void)
    {
      PINSEL10 = 0;                                                         // Disable ETM interface, enable LEDs
      FIO2DIR  = 0x000000FF;                                                // P2.0..7 defined as Outputs
      FIO2MASK = 0x00000000;
    }
    
                                                                                                            // Function that turns on requested LED
    void LED_On (unsigned int num)
    {
      FIO2SET |=  num;
    }
    
                                                                                                            // Function that turns off requested LED
    void LED_Off (unsigned int num)
    {
      FIO2CLR |= num;
    }
    

Children
More questions in this forum