This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Super loop

what is Super loop in Embedded systems?

Parents
  • I dislike the term "super loop" as it implies that there is something special about the loop - but there isn't.

    It is just an endless loop, and the actions of the system all happen continually within the loop.

    Usually, the loop continually checks for events, and takes appropriate action when an event is signalled.
    The events are detected by code outside the loop - such as interrupt handlers.

    Taking the Wikibooks example,

    Function Main_Function()
    {
      Initialization();
    
      Do_Forever
      {
        // The arrival of serial data is recognised in an ISR
        if( serial data received )
        {
            process serial data
        }
    
        // A keypress might be recognised in an ISR,
        // or on a timer interrupt,
        // or by polling, etc
        if( key pressed )
        {
            respond to key press
        }
    
        // The above processing may have resulted in
        // something to be displayed
        if( something to display
        {
            update the display
        }
      }
    }
    

    Note that this has nothing specifically to do with embedded systems.

Reply
  • I dislike the term "super loop" as it implies that there is something special about the loop - but there isn't.

    It is just an endless loop, and the actions of the system all happen continually within the loop.

    Usually, the loop continually checks for events, and takes appropriate action when an event is signalled.
    The events are detected by code outside the loop - such as interrupt handlers.

    Taking the Wikibooks example,

    Function Main_Function()
    {
      Initialization();
    
      Do_Forever
      {
        // The arrival of serial data is recognised in an ISR
        if( serial data received )
        {
            process serial data
        }
    
        // A keypress might be recognised in an ISR,
        // or on a timer interrupt,
        // or by polling, etc
        if( key pressed )
        {
            respond to key press
        }
    
        // The above processing may have resulted in
        // something to be displayed
        if( something to display
        {
            update the display
        }
      }
    }
    

    Note that this has nothing specifically to do with embedded systems.

Children