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?
I suppose that you use a wrong mask. You can also consider using unsigned char instead of unsigned int - in my project it worked perfectly. Regards, Michael.