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

📄 dbgrs485.java

📁 Java Op Processor java vhdl processor
💻 JAVA
字号:
package kfl;/***	Write Rs485 Data with timestamp to serial line.*/public class DbgRs485 {	public static final int IO_PORT = 0;	private static final int IO_UART = 2;	private static final int IO_RS485 = 15;	private static final int IO_STATUS = 1;	public static void main(String[] args) {		Timer.init();		Timer.start();		int val, ts;		for (;;) {			if ((JopSys.rd(IO_STATUS)&32)!=0) {				val = JopSys.rd(IO_RS485);				wr(val);							// write value				ts = JopSys.rd(JopSys.IO_CNT);				for (int i=0; i<4; ++i) {			// write timestamp					wr(ts);							// low byte first					ts >>= 8;				}			}			Timer.wd();		}	}	static void wr(int c) {		while ((JopSys.rd(IO_STATUS)&1)==0) ;		JopSys.wr(c, IO_UART);	}}

⌨️ 快捷键说明

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