sohappyoh 发表于 2014-3-17 15:11:35

WinAVR+GCC ATmeaga64进不了主循环

晕 阿!WinAVR+GCC ATmeaga64进不了主循环

一直到主循环前面都能执行
int main( void )
{
    wdt_disable();
    cli();
    GPIO_Init();
    KeyInit();
    TM1_init();
    //Interrupt0_init();
    sei();



    num_buf = 5;
    _delay_ms(1000);
    num_buf = 4;
    _delay_ms(1000);
    num_buf = 3;
    _delay_ms(1000);
    num_buf = 2;
    _delay_ms(1000);
    num_buf = 1;
    _delay_ms(1000);
    num_buf = 0;

    do
    {
    num_buf = 8;      
      /*
      if(KEY1_SHORT_PRESS)
      {
            num_buf++;
            CLR_KEY1_SPRESS_FLAG;
      }

      if(KEY2_SHORT_PRESS)
      {
            num_buf--;
            CLR_KEY2_SPRESS_FLAG;
      }

      if(KEY3_SHORT_PRESS)
      {
            num_buf = 0;
            CLR_KEY3_SPRESS_FLAG;
      }
      */
    }while(1);
}

页: [1]
查看完整版本: WinAVR+GCC ATmeaga64进不了主循环