我是嵌入式编程的初学者。我正在研究 cranboard (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);
}
}
}
请指导我。
最佳答案
试试uboot的ctrlc
功能:
if(ctrlc())
return 1; // or whatever else you want to do
关于c - 嵌入式:U-boot 终端中 Ctrl-C 中断的 C 编码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15104929/