assigning fixed memory regions to variables that will be modified

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

assigning fixed memory regions to variables that will be modified

1,059 Views
raghav_sarma
Contributor I
Hi again,
 
How can you assign a fixed memory region within RAM to a variable that will be modified i.e. that does not have the qualifier const?
 
e.g.
#pragma CONST_SEG CALIBRATION
Int16 Sb10_Constant8 ;
 
In this case this variable is not assigned an address in the RAM memory region CALIBRATION. When I add the "const" identifier, then this variable is put in the correct memory region, but I get an error when I try to modify it.
 
#pragma CONST_SEG CALIBRATION
const Int16 Sb10_Constant8 ;
 
=> Sb10_Constant8 is assigned the correct location, but elsewhere in the program the statement below gives me an errror - "modifiable value expected". 
 
 Sb10_Constant8 = Sb10_Constant8_ROM;
 
How can I get round this problem?
 
Raghav
Labels (1)
0 Kudos
1 Reply

242 Views
Lundin
Senior Contributor IV
There is a reason it is called CONST_SEG: it only affects constant variables. For non-constant variables, you use DATA_SEG. It works in the same manner in the .prm file.
0 Kudos