ΪʲôλѰַµÄ±äÁ¿£¬Õâô¸³Öµ²»ÐУ¿£¿
- UID
- 83629
- ÐÔ±ð
- ÄÐ
|
ΪʲôλѰַµÄ±äÁ¿£¬Õâô¸³Öµ²»ÐУ¿£¿
unsigned char bdata Iostate;
unsigned char bdata bvar0;
sbit MsFlag = bvar0^5; //0-ON , 1-OFF 5ºÁÃë·×ª±êÖ¾
main£¨£©
{
unsigned char bdata *pp;
¡£¡£¡£¡£¡£¡£
pp = &Iostate;
(*pp)^2=MsFlag; //for syntax check
¡£¡£¡£¡£¡£¡£
ΪʲôÕâôд£¬ (*pp)^2=MsFlag; ÕâÐлá±àÒë´íÎó£¨ TOUCH.C(938): error C141: syntax error near '='£©?
ÎÒÕâôд£¬ÓÐʲô´íÎóÄØ£¿£¡ |
|
|
|
|
|
- UID
- 104631
- ÐÔ±ð
- ÄÐ
|
(*pp)^2=MsFlag;Õâ¸ö²»·ûºÏCµÄÓï·¨£¬¼´Ê¹ÔÚVC±àÒëÆ÷ÀïÃæҲͨ²»¹ýµÄ¡£ |
|
|
|
|
|
- UID
- 83629
- ÐÔ±ð
- ÄÐ
|
Äܲ»ÄÜ˵µÃÃ÷°×Ò»µã£¬¶ÔÓÚλѰַµÄ±äÁ¿£¬Ó¦¸ÃÈçºÎ¸³Öµ£¿ |
|
|
|
|
|
- UID
- 83629
- ÐÔ±ð
- ÄÐ
|
ÎÒ¸Ä³É P0^2= MsFlag; ±àÒ붼»á³ö´í¡£
P0·ÖÃ÷ÊÇ¿ÉÒÔλѰַµÄ°¡£¿£¿£¿ ÎÒ¸ÃÔõôÀí½â£¿Çë½âÊÍ£¬Íò·Ö¸Ðл |
|
|
|
|
|
- UID
- 104631
- ÐÔ±ð
- ÄÐ
|
/*** PTA - Port A Data Register ***/
typedef union {
byte Byte;
struct {
byte PTA0 :1; /* Port A Data Bit 0 */
byte PTA1 :1; /* Port A Data Bit 1 */
byte PTA2 :1; /* Port A Data Bit 2 */
byte PTA3 :1; /* Port A Data Bit 3 */
byte PTA4 :1; /* Port A Data Bit 4 */
byte PTA5 :1; /* Port A Data Bit 5 */
byte PTA6 :1; /* Port A Data Bit 6 */
byte PTA7 :1; /* Port A Data Bit 7 */
} Bits;
struct {
byte PTA :8;
} MergedBits;
} PTASTR;
extern volatile PTASTR _PTA @0x00000000;
#define PTA _PTA.Byte
#define PTA_PTA0 _PTA.Bits.PTA0
#define PTA_PTA1 _PTA.Bits.PTA1
#define PTA_PTA2 _PTA.Bits.PTA2
#define PTA_PTA3 _PTA.Bits.PTA3
#define PTA_PTA4 _PTA.Bits.PTA4
#define PTA_PTA5 _PTA.Bits.PTA5
#define PTA_PTA6 _PTA.Bits.PTA6
#define PTA_PTA7 _PTA.Bits.PTA7
#define PTA_PTA _PTA.MergedBits.PTA
¿ÉÒÔ¿´Ò»ÏÂÓÃCW×Ô¶¯Éú³ÉµÄ¶¨Òå·½·¨¡£
¼ÙÉèPTA0ÖÃλ¿ÉÒÔÕâÑùд
PTA_PTA0=1; |
|
|
|
|
|
- UID
- 115025
- ÐÔ±ð
- ÄÐ
|
codewarriorµÄÿ¸öMCU×Ô¶¯Éú³ÉµÄÍ·Îļþ¶¼ÓÐbit±äÁ¿µÄ±íʾ·½·¨.¿ÉÒÔ²ÎÕÕ,
¸ù¾Ý±àÒëÆ÷µÄ²»Í¬,bitÑ°Ö·µÄ±íʾ·½·¨Ò²²»Í¬.ÄãдµÄÄÇÖÐÔÚkeil±àÒëÆ÷ÊÇÕâÖÖ±íʾ·½Ê½Èç
sbit p10=P1^0;
µ«ÊÇÄãÕâ¾ä
(*pp)^2=MsFlag;
ÔÚÄÄÀïÓ¦¸Ã¶¼ÊÇ´íÎóµÄ.ÒòΪÄã(*pp)^2±íʾµÄÊÇÒì»ò. |
|
|
|
|
|