Hi,
I have firmware that cycles through a linked list of events. Each event has an unsigned int capture/compare value and a pointer to a function. Using Timer_A0 interrupt, the linked list executes the function, cycles to the next node in the list, updates Timer_A0 to the next capture/compare value, and then deletes the node.
I have a loop that constantly adds events to the linked list and it allocates memory for the events using malloc.
I noticed that only 1 out of 3 of the calls to malloc actually succeeds. It follows a pattern of Success, Fail, Fail, Success, Fail, Fail, etc...
Each Node has 3 pointers, an unsigned int, and an unsigned char (so a total of 9 bytes right?)
Can anyone explain why these calls to malloc are failing?
Thanks,
Seth Berggren