keil编译程序出现declaration may not appear after executable statement in block 错误 解决办法

  /* Init System, peripheral clock and multi-function I/O */
    SYS_Init();     

    /* Init UART0 for printf */
    UART0_Init();

     _GPIO_SET_PIN_MODE(P3, 6, GPIO_PMD_OUTPUT);
    int i,j;
    while(1)
    {
        P36 = 0;
        for(i=0;i<10;i++)
            CLK_SysTickDelay(100000);
        P36 = 1;
        for(j=0;j<10;j++)
            CLK_SysTickDelay(100000);
    }

 

编译就会出现declaration may not appear after executable statement in block,

在keil中定义的变量声明不允许出现在语句之后,所以把int i,j;这句放在最前面。

posted on 2018-09-03 17:26  小小小哈  阅读(10999)  评论(0编辑  收藏  举报

导航