⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 schedlast.java

📁 Java Op Processor java vhdl processor
💻 JAVA
字号:
package testrt;import util.*;import joprt.*;import com.jopdesign.sys.*;//	Measure time with for scheduling of lowest priority threadpublic class SchedLast {	static class Busy extends RtThread {		private int w, c;		Busy(int per, int i) {			super(10+i, per);			w = per*9/100;			c = i+'a';		}		public void run() {			for (;;) {				Dbg.wr(c);				int ts = Native.rd(Const.IO_US_CNT);				ts += w;				// busy wait for period end				while (ts-Native.rd(Const.IO_US_CNT)>0)					;				waitForNextPeriod();			}		}	}		public static void main(String[] args) {		Dbg.initSer();				// use serial line for debug output		RtThread rt = new RtThread(9, 1000000) {			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(100000, i);		}		RtThread.startMission();// RtThread.debug();		// sleep		for (;;) {			Timer.wd();			try { RtThread.sleepMs(1200); } catch (Exception e) {}		}	}}

⌨️ 快捷键说明

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