我的实际标题

这是我的第一个标题!

写下自己的测试内容啊。

这是第二级的标题

第3级的标题

第4级的标题

无序列表:
* 1
* 2
* 3
* 4
有序列表:
1. 1
2. 2
3. 3
4. 4
5. 5

例如这样是引用
第二行引用

* 该怎样生成图片的链接地址? *

TablesAreCool
col 3 isright-aligned$1600
col 2 iscentered$12
zebra stripesare neat$1

上面是个分割线
再来一个


终于到了图床了,这里是极简图床:

图片名称 我是黑体字 我是微软雅黑 字体的内容 字体的内容 字体的内容 字体的内容 Size:规定文本的尺寸大小。可能的值:从 1 到 7 的数字。浏览器默认值是 3。 欢迎大家访问我的博客首页 百度一下 ***
 #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 波形图:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值