CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

problem to retrieve a image store in program memory

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
wlpuah
Guest







problem to retrieve a image store in program memory
PostPosted: Wed Jan 21, 2009 2:14 am     Reply with quote

Compiler PCH v4.039 PIC18F66J60.
I store a large image which is defined
Code:
const char Imag[] = {0x00,0x01, ........};

about 2000 element.
Code below can retrieve data in image correctly
Code:
memcpy(cData, Imag, wLen);


Since I need to access the image not just from the beginning
but code below cannot retrieve data in image correctly even if the addr is 0.
Code:
memcpy(cData, Imag + addr, wLen);

How can I access the data image ? Thanks in advance.
wlpuah
Guest







PostPosted: Wed Jan 21, 2009 2:56 am     Reply with quote

problem are solve by using following codes to retrieve data from image.
code:
for (i = 0; i < wLen; i++)
{
*cData = Imag[addr];
addr++;
cData++;
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group