This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C51: Bit arrays

I'm using an array of ints in the bit addressable memory area as a crude bit array

bdata unsigned int sample_window[SAMPLE_WINDOW_LENGTH];
//bit addressable array in bit memory

I'm using a mask to read from the array, however when I try to write a new bit in using the mask and a bitwise ex-or bits in more than one byte get changed.

sample_window[byte] = ((sample_window[byte]) ^ mask);
//change location by bit exor

any ideas on a better implementation?

0