Hi,
I'm having a little weird issue in my code running on a ARM Cortex M0 (LPC1114), probably is just a ridiculous mistake bypassing my view. I'm using LPCXpresso IDE, coding in C.
Let me break it down for you guys:
I have one typedef struct in my code that defines my circular buffer nodes. Exactly the same below.
typedef struct {
uint8_t addr;
uint8_t offset;
uint8_t rw;
uint8_t size;
uint8_t status;
uint8_t data[8];
} EEPROM_MemoryPageNode;
My read function receives one pointer of that structure above as a parameter to retrieve data. Function declaration below.
uint8_t _EEPROM_readBytes(uint8_t address, uint8_t size, EEPROM_MemoryPageNode* mem);
Inside the function I catch the memory address of my last node in my circular buffer.
...
mem = (EEPROM_MemoryPageNode)&_pageNodes[_stopNode];
...
Here comes the issue. I call the function as below:
...
EEPROM_MemoryPageNode* mem;
_EEPROM_readBytes(0x00, 0x01, mem );
...
It compiles ok, but for some reason the variable "mem" doesn't catch the address of my node! I did some debugging and could not fix it.
As I said earlier, probably a small detail escaping through my hands. Any help is welcome.
Thank you.