vendredi 31 juillet 2015

Structure and memcpy warning

I would like copy data from flas into RAM (microcontroller) in structure. And I have structure initialization:

typedef struct Day{
    long AM : 24;
    long PM : 24;
}Day;

struct Data{
    unsigned long Lang   : 8;
    struct Day dawt[7];

}Data;

Load from flash into RAM I have with this function

void LoadFromFlash(){
    int count;

    memcpy(Data.Lang, F_DATA, 1);
    for(count = 0; count < 7;  count++){

        memcpy(Data.dawt[count].AM, F_DATA, 3);
        memcpy(Data.dawt[count].PM, F_DATA, 3);
    }
}

I get warning:

passing argument 1 of 'memcpy' makes pointer from integer without a cast

for all mempcy function

and

passing argument 2 of 'memcpy' makes pointer from integer without a cast

for #define statement

#define F_DATA      0x00006000

What's wrong.

Aucun commentaire:

Enregistrer un commentaire