led is not blinking whiel simulation

#define ledon IO1SET
#define ledoff IO1CLR

void EDF_scheduler(void);
int main(void)
{ IODIR1 = 0x00FF0000; scheduler();
}

void scheduler(void)
{ while(1){ int i,time=0; int curr_process=0; while(time<sim_time) { if(curr_process > -1) { if(array[curr_process].ceu < array[curr_process].wcet ) { array[curr_process].ceu++;
if((array[curr_process].task_id )==1 ) { here i want to blink led ledon = (1<<16); // Turn ON P1.16 – P1.23 delay(900000); ledoff= (1<<16); // Turn OFF P1.16 – P1.23

}

if((array[curr_process].task_id) ==2 ) { ledon = (1<<17); // Turn ON P1.16 – P1.23 delay(9000); ledoff= (1<<17); }

Parents
  • Did you find it hurtful to have to read through the posting instructions "Tips for Posting Messages"? Did your code come out well, after you skipped the instructions how to post formatted source code?

    ledon = (1<<16); // Turn ON P1.16 – P1.23
    


    So you are writing a single bit as high. How can you then claim in your comment that you are turning on P1.16, P1.17, P1.18, P1.19, P1.20, P1.21, P1.22 and P1.23? Don't you think you have to set _eight_ bits if you want to activate 8 outputs?

    You have this source line:

    void EDF_scheduler(void);
    

    But there doesn't seem to be any implementation of such a function. And no call to such a function. On the other hand, you call a function scheduler() - but before the compiler knows about the existence of such a function.

    If you want help with your code, wouldn't it then be good if you post code that is actually building correctly?

Reply
  • Did you find it hurtful to have to read through the posting instructions "Tips for Posting Messages"? Did your code come out well, after you skipped the instructions how to post formatted source code?

    ledon = (1<<16); // Turn ON P1.16 – P1.23
    


    So you are writing a single bit as high. How can you then claim in your comment that you are turning on P1.16, P1.17, P1.18, P1.19, P1.20, P1.21, P1.22 and P1.23? Don't you think you have to set _eight_ bits if you want to activate 8 outputs?

    You have this source line:

    void EDF_scheduler(void);
    

    But there doesn't seem to be any implementation of such a function. And no call to such a function. On the other hand, you call a function scheduler() - but before the compiler knows about the existence of such a function.

    If you want help with your code, wouldn't it then be good if you post code that is actually building correctly?

Children
More questions in this forum