This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/CC3200: Bit Array structure is not accessible

Part Number: CC3200

Tool/software: TI C/C++ Compiler

Hello,

I created bit array and trying to access individual bits. But This compiler is not allow to access bit from that memory address of Bit array.

Please verify and let me know if anything wrong. Same code i ran in GCC compiler it worked but not in Ti compiler.

#define ARRAY_SIZE(x) (x/8+(!!(x%8)))
unsigned char array[1],   ulData[1]={0};

unsigned char CoilReg[ARRAY_SIZE(8)]; 

void Status(unsigned char *ulData)
{
int i;
for(i=0; i <= 8 ; i++)
{
if(CoilReg[i] ==0)
{
ulData[1+((i)/8)] &= ~( 1 << (i % 8)) ;
}
else
{
ulData[1+(i/8)] |= ( 1 << (i% 8));
}
//printf( "coil Status : %d\n", CoilReg[i] );
//printf( "Individual Status : %d\n", ulData[i/8] );
}
printf( "Sizeof( Array ) : %d\n", ulData[1] );
//printf( "coil Status : %d\n", CoilReg[ARRAY_SIZE(8)]);
}

int main( ) {

unsigned char Bitstatus, Temp[1];
//printf( "Sizeof( Array ) : %d\n", sizeof(array) );
array[0] = 0x0A;
Status(Temp);

}