[转帖]是否有可能在运行时改变端口的缓存模式?
回答:
端口配置可以通过使用在执行中的程序的SETC指令来改变。例如:
#define SETPORTBUFFERED(p, bits) asm("setc res[%0], 0x200f \n settw res[%0], %1 \n " : : "r"(p), "r"(bits) );
#define SETPORTUNBUFFERED(p) asm("setc res[%r], 0x2007" ::"r"(p));
发表时间:2014年8月27日15:25:24