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

Use an Internal Eeprom value

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



Joined: 11 Oct 2017
Posts: 142

View user's profile Send private message

Use an Internal Eeprom value
PostPosted: Fri Nov 01, 2019 4:15 am     Reply with quote

How to use a value stored in the internal Eeprom to define a value in a table?
Example:
Code:
#ROM int8 0xF00000 = {0x00}


Code:
   const char USB_DEVICE_DESC[USB_DESC_DEVICE_LEN] ={
      //starts of with device configuration. only one possible
         USB_DESC_DEVICE_LEN, //the length of this report   ==1
         0x01, //the constant DEVICE (DEVICE 0x01)  ==2
         0x10,0x01, //usb version in bcd (pic167xx is 1.1) ==3,4
         ??, //USE HERE VALUE RECORDED AT THE POSITION 0
   };
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Fri Nov 01, 2019 4:25 am     Reply with quote

You don't.

Your device descriptor would have to be made a RAM value (get rid
of const), then it can be written.

You can then use:

*(((byte *)&USB_DEVICE_DESC)+4) =read_eeprom(0);

Which will write the byte from the EEPROM into the device descriptor.
vtrx



Joined: 11 Oct 2017
Posts: 142

View user's profile Send private message

PostPosted: Fri Nov 01, 2019 6:01 pm     Reply with quote

Could you show me the example above changed?
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