A
Anil
hi
will the following code work.
typedef struct
{
unsigned char date[64];
unsigned char sortie_num[64];
unsigned int start_address[64];
unsigned short offset[64];
} sortie_data;
unsigned short table_buff[256];
sortie_data *sort_temp = (sortie_data *)table_buff ; // pointer to
structure containing table
read(table_sector,table_buff); // read the required sector from the
flash disk
sort_temp ->date[sector_position] = date1;
sort_temp ->sortie_num[sector_position] = sortie_number2;
sort_temp ->start_address[sector_position] = secnum;
sort_temp ->offset[sector_position] = offset;
// write the table back in flash
write(table_sector,table_buff);
read and write are some functions which take a input of unsigned short
table_buff[256], table_sector is some location of the same size of
table_buff[256]. but here the the data is written and read as unsigned
short. the values read back are modified as above.
regards
Anil
will the following code work.
typedef struct
{
unsigned char date[64];
unsigned char sortie_num[64];
unsigned int start_address[64];
unsigned short offset[64];
} sortie_data;
unsigned short table_buff[256];
sortie_data *sort_temp = (sortie_data *)table_buff ; // pointer to
structure containing table
read(table_sector,table_buff); // read the required sector from the
flash disk
sort_temp ->date[sector_position] = date1;
sort_temp ->sortie_num[sector_position] = sortie_number2;
sort_temp ->start_address[sector_position] = secnum;
sort_temp ->offset[sector_position] = offset;
// write the table back in flash
write(table_sector,table_buff);
read and write are some functions which take a input of unsigned short
table_buff[256], table_sector is some location of the same size of
table_buff[256]. but here the the data is written and read as unsigned
short. the values read back are modified as above.
regards
Anil