Menu

How to delay?

Help
Anonymous
2010-11-20
2012-12-09
  • Anonymous

    Anonymous - 2010-11-20

    I'm trying to delay a task but this seems to not work.

    /* Infinite task displaying the state */
    void appLoop_LEDtask(void)
    { 
        DDRB = 0xFF;
        while (true)
        { 
            PORTB = 0xFF;
            taskDelayFromNow(3000);
            PORTB = 0x00;
            taskDelayFromNow(3000);
        } 
    }
    

    I've tried to delay with _delay_ms() and _delay_loop_2() but that didn't work either. I removed the includes (they are removed entirely so they're not just commented out) but no chance. My leds are turned on and do not blink.

    I set cfgUseDelay and includeTaskDelayFromNow to cfgTrue and the rest is from the config file of the minimal demo.

    What's going wrong?

     
  • Anonymous

    Anonymous - 2010-11-20

    The leds stay switched on.

     
  • Daniel Berg

    Daniel Berg - 2010-11-20

    It looks ok, so there is probably something with the configuration.

    Do you use the HelloWorld-setup? And Standard, not compact mode?

    In the config file, check that you have something like this:

    #define  CN_00                                   LEDTask         // where 00 can be 01 or 02 depending on other tasks
    #define TaskInclude_LEDTask                    cfgStartRunning
    

    If you have other tasks with different priorities, check that no other task (with higher priority) have 100% runtime.

     
  • De Vlaam

    De Vlaam - 2010-11-20

    As dbkey says, start from the Hello-World example , the minimal demo configuration can not be used

     

Log in to post a comment.