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

📄 scope.c

📁 实时linux RTAI 下的如何使用RTFIFO代码
💻 C
字号:
#include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/mman.h>#include <sys/stat.h>#include <fcntl.h>#include <signal.h>static int end;static void endme(int dummy){	end=1;}int main(int argc, char * argv[]){	int fifo, counter;	float sin_value;	if ((fifo = open("/dev/rtf0", O_RDONLY)) < 0) {		fprintf(stderr, "Error opening /dev/rtf0\n");		exit(1);	}	signal(SIGINT, endme);	while (!end) {		read(fifo, &counter, sizeof(counter));		read(fifo, &sin_value, sizeof(sin_value));		printf(" Counter : %d Seno : %f \n", counter, sin_value);	}	return 0;}

⌨️ 快捷键说明

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