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

📄 periodic.java

📁 Java Op Processor java vhdl processor
💻 JAVA
字号:
package testrt;import joprt.RtThread;import util.Dbg;import util.Timer;import com.jopdesign.sys.Const;import com.jopdesign.sys.Native;public class Periodic {	public static void main(String[] args) {		Dbg.initSerWait();				// use serial line for debug output		RtThread rt = new RtThread(10, 100000) {			public void run() {				int ts, ts_old;				waitForNextPeriod();				ts_old = Native.rd(Const.IO_US_CNT);				for (;;) {					waitForNextPeriod();					ts = Native.rd(Const.IO_US_CNT);					Result.printPeriod(ts_old, ts);					ts_old = ts;				}			}		};		//		// do busy work		//		RtThread rts = new RtThread(9, 1000000) {			public void run() {				for (;;) {Dbg.wr('*');					waitForNextPeriod();					int ts = Native.rd(Const.IO_US_CNT) + 990000;					while (ts-Native.rd(Const.IO_US_CNT)>0)						;				}			}		};		RtThread.startMission();		// sleep		for (;;) {Dbg.wr('M');// RtThread.debug();			Timer.wd();			RtThread.sleepMs(1200);		}	}}

⌨️ 快捷键说明

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