Content originally posted in LPCWare by Poenie on Tue Mar 08 06:17:31 MST 2011
I did view that page, which is why I mentioned the "hard reset by grounding P0_1 when asserting reset". I can reset the target, but can not debug via Xpresso.
I now installed Flash Magic, which works. That means I can no longer debug through the LPCXpresso program (Still does not pick up board, even when reset). I program in it, then debug through Flash Magic, which means I have to follow the above reset procedure every time. But at least it works.
My problem now is to create a dynamic array. I created a struct:
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]struct[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] nodeType
{
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]info[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]struct[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] nodeType *[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]link[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]count[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
} ;
 
and directly below I declare the pointers:[/LEFT]
nodeType [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]__attribute__[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ((__packed__))*first, *newNode, *last, *current;[/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]The compiler kept complaining about "expected '=', ',' , ';' 'asm' or '__attribute__' before '*'"[/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]So I changed it to :[/SIZE]
[SIZE=2][/SIZE]
nodeType [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]__attribute__[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ((__packed__))*first, *newNode, *last, *current;[/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]Now I get:[/SIZE]
[SIZE=2]"expected ',' or ';' before '*'"[/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]Not sure what [COLOR=#7f0055][B]__attribute__ [/B][/COLOR][SIZE=3][COLOR=#000000]does yet, but will do more reading. [/COLOR][/SIZE][/SIZE]
I tested the code in Visual Studio C++, where it worked well. It looks correct for C though..?
What I want to accomplish is to create a dynamic array to accept data packets from a master via SPI. Because I do not know the size untill actually receiving the 3rd byte, it should be dynamic, thus a linked list.
[SIZE=2][/SIZE]
[U][SIZE=2]
[/SIZE][/U]