ThomasC
Joined: 09 Oct 2007 Posts: 62
|
Structure Elements in Watch Window 'out of scope' |
Posted: Mon Apr 07, 2008 4:43 pm |
|
|
I don't see the structure node elements in the Watch Window of MPLAB IDE 8.00. I am running CCS Compiler PCM 4.060, ICD2, PIC16F690-ICD.
It shows 'out of scope'.
I am trying to take in variable length string on the fly. It can be 8-520 bytes. I am trying to take one byte at a time through ram, store it in program memory, free up the ram, then repeat until the entire command string is taken in.
Does anyone have any ideas on what could be causing this? Any help would be greatly appreciated.
Related Structure Code Attached:
Code: |
struct node //declare structure GetIn485Command
{
char inputstring; //declare member variable - takes in 1 byte per loop
struct node *nextptr; //declare member variable
}; struct node *ptr1,*startptr;
char mychar; //declare variable
Main void()
{
while(1)
{
delay_ms(10);
reset_uart(); //Resets Serial Port / USART
clear_usart_transmitter(); //Clear the USART transmit register and its fifo by reading it three times.
clear_usart_receiver(); //Clear the USART receive register and its fifo by reading it three times.
delay_ms(2.4);
//delay_ms(10);
//Slave--->Master
// TF(); //Updates Array Opcode204[] to transmit Temperature Function Values
//COMMAND - MASTER--->SLAVE
//Dynamic Memory Function for receiving command from Master
ptr1 = malloc(sizeof(struct node));
mychar =getc();
ptr1->inputstring = mychar; // ->Structure Pointer Operation
ptr1->nextptr = NULL;
startptr = ptr1;
// mychar = getc();
While (mychar!=26) //takes in 1 byte at a time from Command
{ //may need to try hex number instead of 26
ptr1->nextptr = malloc(sizeof(struct node));
ptr1 = ptr1->nextptr;
ptr1->inputstring = mychar; //ptr->membervar1 = var;
ptr1->nextptr = NULL; //ptr->memebervar2 = NULL;
mychar = getc(); //store incomming byte in mychar, RAM
//Copy from RAM to program memory, RAM can handle 253 bytes max.
//free RAM
}
}
}
|
Screenshot Link Here:
http://forum.microchip.com/forceddownload.aspx?file=0%3b328517 |
|