bit x; …… …… x = Read_Bit_P1(0); // Read Port 1, Pin 0 …… …… bit Read_Bit_P1(unsigned char Pin) { unsigned char p = 1; p <<= Pin; // Left shift // Write a 1 to the pin (to set up for reading) Write_Bit_P1(Pin, 1); return (P1 & p); // Read the pin } 为什么return (P1 & p); 是返回bit类型的,而不是char类型的? |