I am programing in C and i just came across a problem with the pointer to array. I am tring to do a system that has structures like Digital Inputs, Digital Outputs, Analog Inputs exc... All structures have the same charateristics ...
Code:
typedef union
{
structu
{
unsigned bs:1;
unsigned bc:1;
unsigned ba:1;
unsigned ac:1;
}bit;
shor int all;
}DI_Bits;
typedef sruct
{
DI_Bits bits;
UINT16 alm_timer;
UINT16 delay_time;
UINT16 sim_delay;
}DigitalInputs;
Code:
// header file static short int *bits[20]; static short int *reg[20];
Code:
//source file
DigitalInputs DI;
//for bits
static short int *bits = {
&DI.bits.all, // this way I included all other structures that holds the bits
};
// for registers
static short int *bits = {
&DI.alm_timer,
&DI.delay_time,
&DI.sim_delay
};
So i am wantering what I did wrong. Since I want to test this with Dev-Cpp before uploading the software on the microchip I am cindly aking you guys for some help.
Thanks and
Best Regards,
BoSCHoW.
