📄 om.c
字号:
#include "pioLib.h"#include "msgQLib.h"/* Port C is actually hardwired to Port A. By changing the state of * one of the first three channels of Port C, we changed the input to * Port A. */STATUS flurbish (state) BOOL state; { return (pioSet (PORT_C, 0, state)); }STATUS dohickey (state) BOOL state; { return (pioSet (PORT_C, 1, state)); }STATUS nevester (state) BOOL state; { return (pioSet (PORT_C, 2, state)); }void monitorOM (msgQId, debug) MSG_Q_ID msgQId; int debug; { PIO_MSG_Q_DATA msgQData; int channel; /* Initialize the PORT B channels to OFF */ for (channel=0; channel<PIO_MAX_CHANNELS_PER_PORT; channel++) pioSet (PORT_B, channel, OFF); FOREVER { if (msgQReceive (msgQId, (char *) &msgQData, sizeof (PIO_MSG_Q_DATA), WAIT_FOREVER) == ERROR) { printf ("msgQReceive failed\n"); return; } pioSet (PORT_B, msgQData.channel, msgQData.state);#ifndef NDEBUG if (debug) printf ("port %d channel %d state %d time %d\n", msgQData.port, msgQData.channel, msgQData.state, msgQData.timeStamp);#endif } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -