I'm new to C and I had a couple questions about getting struct values into a function and the correct way to declare the function.
in my common.h I've defined
extern struct ddrautocal;
int get_eeprom_vals(uchar); // is this the correct declare the function?
in calibration.c I define my struct and change some set some values (not shown)
#include <common.h>
struct ddrautocal {
u32 wdtr;
u32 clkp;
u32 rdcc;
};
in proc.c
#include <common.h>
int get_eeprom_vals(struct ddrautocal *cal){
// I'd like to access cal.wdtr and cal.clkp
}
I'm a complete derp, I know but I'm trying to get better. I've been trying to get this working all day and would like to know if I am declaring the function correctly in common.h and what is the correct way to access the ddrautocal struct in my get_eeprom_vals function located in proc.c Any help would be greatly appreciated. Thanks!