while(1) { slwr = LED_2_GetState() & 0x01; while (slwr == 0x01) { slwr = LED_2_GetState() & 0x01; pdata_len = 0; } while (slwr == 0x00) //程序在这里不出来了. { LED_1_Start(); LED_1_Switch(0x00); LED_1_Switch(0x01); pdata_buff[pdata_len] = PRT0DR; pdata_len++; slwr = LED_2_GetState() & 0x01; } pdata_len = 0; }
程序如上所示. LED_1作为输出口P2_3.ide环境中设置的是strong LED_2作为输入口P2_0.ide环境中设置的是HIGH z 现在程序是在第3个WHILE循环里不出来了.太奇怪了.折磨我2天了.
|