这是我的第一个标题!
写下自己的测试内容啊。
这是第二级的标题
第3级的标题
第4级的标题
无序列表:
* 1
* 2
* 3
* 4
有序列表:
1. 1
2. 2
3. 3
4. 4
5. 5
例如这样是引用
第二行引用
* 该怎样生成图片的链接地址? *
Tables | Are | Cool |
---|---|---|
col 3 is | right-aligned | $1600 |
col 2 is | centered | $12 |
zebra stripes | are neat | $1 |
上面是个分割线
再来一个
终于到了图床了,这里是极简图床:

#include <stdio.h>
#include <cstring>
#include <cstdio>
int main(int argc, char const *argv[])
{
int a = 1;
String str = "abc";
scanf("%d", &a);
cout <<"str:"<< str << endl;
return 0;
}
我自己的代码片:
/*
* ioctl.c - the process to use ioctl's to control the kernel module
*
* Until now we could have used cat for input and output. But now
* we need to do ioctl's, which require writing our own process.
*/
/*
* device specifics, such as ioctl numbers and the
* major device file.
*/
#include "blink.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h> /* open */
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <sys/ioctl.h> /* ioctl */
/*
* Functions for the ioctl calls
*/
void ioctl_ON_LED(int file_desc)
{
int ret_val;
ret_val = ioctl(file_desc, IOCTL_ON_LED, NULL);
if (ret_val < 0)
{
printf("ioctl_ON_LED failed:%d\n", ret_val);
exit(-1);
}
}
void ioctl_OFF_LED(int file_desc)
{
int ret_val;
ret_val = ioctl(file_desc, IOCTL_STOP_LED,NULL);
if (ret_val < 0)
{
printf("ioctl_OFF_LED failed:%d\n", ret_val);
exit(-1);
}
}
/*
* Main - Call the ioctl functions
*/
int main()
{
int exitflag=1;
int file_desc;
int fd;
unsigned icount = 0;
int irq_on = 1;
int err;
// danJian chuFa
int z_f = 1;
printf("################################ \n\r");
printf(" Blink LED Application \n\r");
printf("################################ \n\r");
file_desc = open(DEVICE_FILE_NAME, O_RDWR | O_SYNC);
if (file_desc < 0)
{
printf("Can't open device file: %s\n", DEVICE_FILE_NAME);
exit(-1);
}
/* Open the UIO device file */
printf("pin UIO test.\n");
fd = open("/dev/uio1", O_RDWR);
if (fd < 1) {
printf("Invalid UIO device file: /dev/uio1 !!!.\n");
return -1;
}
while (exitflag)
{
/* Print out a message, for debugging. */
if (icount == 0) {
z_f = 1;
fprintf(stderr, "Started uio test driver.\n");
}
else {
fprintf(stderr, "Interrupts: %d\n", icount);
z_f = 0 - z_f;
}
/* enable IRQ, trigger the irqcontrol of driver */
write(fd, &irq_on, sizeof(irq_on));
/* Here we got an interrupt from the
device. Do something to it. */
if ( z_f == 1 ) {
ioctl_ON_LED(file_desc);
exitflag = 1;
}
else if ( z_f == (-1) ){
ioctl_OFF_LED(file_desc);
exitflag = 1;
}
else
exitflag = 0;
err = read(fd, &icount, 4);
if (err != 4) {
perror("uio read:");
break;
}
}
close(file_desc);
printf("################################ \n\r");
printf(" Bye Blink LED Application \n\r");
printf("################################ \n\r");
return 0;
}
ila 波形图: