Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Issue with accessing bit fields bytewise on C2000

$
0
0

Hello,

I want to use the union below to access bit fields bytewise.  However, it doesn't work on the C2000 because an unsigned char is essentially an unsigned int.

Is there a way to make it work?

Stephen

 

typedef union _ABC123

   struct

    {

        unsigned char Low0;

        unsigned char Low1;

        unsigned char High0;

        unsigned char High1;

    } b8;

    struct

    {

        unsigned int b0 : 1;

        unsigned int b0 : 1

        unsigned int b0 : 1;

        unsigned int b0 : 1

        unsigned int b0 : 1

        unsigned int b5 : 1;

        unsigned int b6 : 1;

        unsigned int b7 : 1;

        unsigned int b8 : 1;

        .....

    } b1

} ABC;

 


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>