I'm using a PIC32MZ and want to open a number of .bmp files and then move their image data into a SRAM. I know the names of the .bmp files and need to extract the height, width, etc and then use this info to properly transfer and store the image data.
So, I set up a typedef struct to define a type that will contain the image info. I strcpy the file name into the struct in main(). I want to call a function to open the file, extract the image data, and put it into my SRAM.
My simplified code is below. I'm unable to pass the image file name to the function. The error is "error: incompatible types when assigning to type 'char[64]' from type 'char (*)[64]'
What am I doing wrong?
Code:
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
typedef struct{
char imageFileName[64];
uint16_t imageHeight;
uint16_t imageWidth;
uint32_t imageStart;
} IMAGE_DATA;
IMAGE_DATA imageData;
IMAGE_DATA running;
char bmp_fileName[64];
uint16_t bmp_height;
uint16_t bmp_width;
uint16_t bmp_start;
void Load_Image(IMAGE_DATA *);
main(){
strcpy(running.imageFileName,"Running16.bmp");
running.imageHeight = 128;
running.imageWidth = 128;
running.imageStart = 84;
Load_Image(&running);
}
void Load_Image(IMAGE_DATA *imageData){
bmp_fileName = &(imageData->imageFileName); // error is here
bmp_height = &(imageData->imageHeight);
bmp_width = &(imageData->imageWidth);
bmp_start = &(imageData->imageStart);
}