嵌入式:C编码用于u-boot终端中的Ctrl-C中断

Gom*_*omu 6 c embedded arm interrupt u-boot

我是嵌入式编程的初学者.我正在研究起重机(ARM Cortex A8).源代码可以在github上找到.

我创建了一个C代码,通过GPIO连接外部LED,闪烁.它可以作为命令在u-boot控制台中执行.目前,

我无法通过Ctrl-C停止LED的闪烁.
Ctrl-C中断的编码在哪里?

ret=set_mmc_mux();
if(ret<0)
    printf("\n\nLED failed to glow!\n\n");
else{
        if(!omap_request_gpio(lpin))
    {
        omap_set_gpio_direction(lpin,0);

        for(i=1;i<21;i++)
        {
            ctr=0;
            if((i%2)==0)
            {
                num=num-1;
                omap_set_gpio_dataout(lpin,num);
            }
            else
            {
                num=num+1;
                omap_set_gpio_dataout(lpin,num);
            }

                    udelay(3000000);
             }

        }
}
Run Code Online (Sandbox Code Playgroud)

请指导我.

nne*_*neo 3

尝试一下ubootctrlc功能:

if(ctrlc())
    return 1; // or whatever else you want to do
Run Code Online (Sandbox Code Playgroud)