SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By Sirtedward
#6326
Hi All,
I was converting the free TI MSP430 TCP/IP project to the latest IAR430 V3.30A. However I have hit a problem, I get an error compiling:
Code: Select all

// copies bytes from MCU-memory to frame port
// NOTES: * an odd number of byte may only be transfered
//          if the frame is written to the end!
//        * MCU-memory MUST start at word-boundary

void CopyToFrame8900(void *Source, unsigned int Size)

{

  P5DIR = 0xFF;                                  // data port to output
  while (Size > 1) {
    WriteFrame8900(*((unsigned int *)Source)++);
    Size -= 2;
  }

  if (Size)                                      // if odd num. of bytes...
    WriteFrame8900(*(unsigned char *)Source);    
}                                                // ignores the highbyte)

And so I thought to split the line:
Code: Select all
WriteFrame8900(*((unsigned int *)Source)++);
To:
Code: Select all
WriteFrame8900(*(unsigned int *)Source);
Source++;
Because it seemed a bit crazy! The problem is that it is a void type data pointer which needs to be incremented by one.… I will get the project uploaded in a bit.....
By m
#6597
That's a mistake. You want to change that ++ to read
Code: Select all
Source += sizeof(unsigned int);
If you want to split that line out.
By RonG
#7284
Sirtedward wrote:I will get the project uploaded in a bit.....
Did you get the code converted over? Is it available?

Ron