test_unrt.c

来自「LINUX下的UART驱动程序」· C语言 代码 · 共 27 行

C
27
字号
#include <linux/kernel.h>#include <linux/module.h>int init_module(void){	int red;	s3c2410_serial_open();	printk("the COM2 is open\n");	char *pstr = "success\n";	red = s3c2410_serial_write(pstr,8);	printk("the len of string is <%d>\n",red);		char str[1024];	memset(str,'\0',1024);	red = s3c2410_serial_read(str,10);	printk("the send string is [%s]\n",str);	printk("the len of string is <%d>\n",red);	return 0;}void cleanup_module(void){	printk("the test is over\n");}

⌨️ 快捷键说明

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