LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Cvs-checkins > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: cvs at opencores.org<cvs@o...>
    Date: Mon Nov 13 15:54:22 CET 2006
    Subject: [cvs-checkins] MODIFIED: jop ...
    Top
    Date: 00/06/11 13:15:54

    Added: jop/java/target/src/rtapi/safetycritical/examples
    PeriodicSporadic.java TwoPeriodic.java
    Log:
    Examples for safety-critical Java


    Revision Changes Path
    1.1 jop/java/target/src/rtapi/safetycritical/examples/PeriodicSporadic.java

    http://www.opencores.org/cvsweb.shtml/jop/java/target/src/rtapi/safetycritical/examples/PeriodicSporadic.java?rev=1.1&content-type=text/x-cvsweb-markup

    Index: PeriodicSporadic.java
    ===================================================================
    package safetycritical.examples;

    import safetycritical.RtEvent;
    import safetycritical.RtSystem;

    public class PeriodicSporadic {

    /**
    * @param args
    */
    public static void main(String[] args) {

    new RtEvent("SWEVENT", 1000000) {
    protected boolean run() {
    System.out.println("SW event fired");
    return true;
    }
    };

    new MyPeriodic();

    RtSystem.start();
    }

    }

    class MyPeriodic extends RtEvent {

    int counter;

    public MyPeriodic() {
    super(1000000);
    counter = 0;
    }

    protected boolean run() {
    System.out.println("P2");
    ++counter;
    if (counter%2==1) {
    RtSystem.fire("SWEVENT");
    }
    if (counter==10) {
    RtSystem.stop();
    }
    return true;
    }

    protected boolean cleanup() {
    System.out.println("cleanup invoked!");
    return true;
    }

    }


    1.1 jop/java/target/src/rtapi/safetycritical/examples/TwoPeriodic.java

    http://www.opencores.org/cvsweb.shtml/jop/java/target/src/rtapi/safetycritical/examples/TwoPeriodic.java?rev=1.1&content-type=text/x-cvsweb-markup

    Index: TwoPeriodic.java
    ===================================================================
    package safetycritical.examples;

    import safetycritical.RtEvent;
    import safetycritical.RtSystem;

    public class TwoPeriodic {

    /**
    * @param args
    */
    public static void main(String[] args) {

    new RtEvent(1000000) {
    protected boolean run() {
    System.out.println("P1");
    return true;
    }
    };

    new MyEvent();

    RtSystem.start();

    }

    }
    class MyEvent extends RtEvent { int counter; public MyEvent() { super(2000000); counter = 0; } protected boolean run() { System.out.println("P2"); ++counter; if (counter==5) { RtSystem.stop(); } return true; } protected boolean cleanup() { System.out.println("cleanup invoked!"); return true; } }

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.