当前位置:网站首页>Keil c's switch statement causes the chip to not run normally

Keil c's switch statement causes the chip to not run normally

2022-06-22 06:25:00 qasxc78563

There is a problem

switch (opratComd)
{
    
	case COMD_Watch:
	printfStr("-------------COMD_Watch\n");
	break;

	case COMD_Open:
	printfStr("-------------COMD_Open\n");
	break;	
}

The above paragraph is missing default:break; sentence , however keil Compile without error

natural

switch (opratComd)
{
    
	case COMD_Watch:
	printfStr("-------------COMD_Watch\n");
	break;

	case COMD_Open:
	printfStr("-------------COMD_Open\n");
	break;

	default:
	return opratComd;
	break;		
}
原网站

版权声明
本文为[qasxc78563]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206220617487221.html