C Bitfields mapped to MSP430 Register

Comments

2 comments

  • Avatar
    Nick Price

    Looks like you are used to using IAR workbench, which has this as default.

     

    Below is the code from IAR, haven't tried it.

     

    /* Port 2 Output */
    __no_init volatile union
    {
      unsigned char P2OUT;
      struct
      {
        unsigned char P2OUT_0        : 1;
        unsigned char P2OUT_1        : 1;
        unsigned char P2OUT_2        : 1;
        unsigned char P2OUT_3        : 1;
        unsigned char P2OUT_4        : 1;
        unsigned char P2OUT_5        : 1;
        unsigned char P2OUT_6        : 1;
        unsigned char P2OUT_7        : 1;
      } P2OUT_bit;
    } @ 0x0029;

     

    Nick

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    There is no way to "fix" this because such use is non-standard.

    0
    Comment actions Permalink

Please sign in to leave a comment.