periodicunrel.java

来自「Java Op Processor java vhdl processor」· Java 代码 · 共 62 行

JAVA
62
字号
package testrt;import util.*;import joprt.*;import com.jopdesign.sys.*;//	use differnet (unrelated) period to find WC Jitterpublic class PeriodicUnrel {	static class Busy extends RtThread {		private int c;		Busy(int per, int ch) {			super(5, per);			c = ch;		}		public void run() {			for (;;) {//				Dbg.wr(c);				waitForNextPeriod();			}		}	}		public static void main(String[] args) {		Dbg.initSer();				// use serial line for debug output		RtThread rt = new RtThread(10, 100000) {			public void run() {				waitForNextPeriod();				int ts_old = Native.rd(Const.IO_US_CNT);				for (;;) {					waitForNextPeriod();					int ts = Native.rd(Const.IO_US_CNT);					Result.printPeriod(ts_old, ts);					ts_old = ts;				}			}		};		int i;		for (i=0; i<10; ++i) {			new Busy(2345+456*i, i+'a');		}		RtThread.startMission();		// sleep		for (;;) {			Dbg.wr('M');			Timer.wd();			for (;;) ;			// try { Thread.sleep(1200); } catch (Exception e) {}		}	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?