Hello, While building a project this message appears:
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?CO?AMPL_DRIVER
I know that this warning indicates that there is a part of code in the ampl_driver file that is excluded from the overlay process.
after searching (by commenting code parts) I found out that the warning is caused from a constant 'ref_int_tmpr', which is declared at the 'ampl_driver' file and is used only once in the same file and nowhere else in the project. The constant is used by a function which is included only if defined earlier:
// global declaration: const float code ref_int_tmpr = 40; ... #ifdef __LT out_sig[i] = (out_sig[i] / get_RAM_gain_factor(ampl_param.working_gain)) - low_temperature_correction(case_temperature,t_index,i); #else if(!sensor_mode.delta) { //signal with temperature correction out_sig[i] = (out_sig[i] / get_RAM_gain_factor(ampl_param.working_gain)) * ((1 + ref_int_tmpr * ID1_xram.alpha[i]) / (1 + get_temp_sensor() * ID1_xram.alpha[i])); }//if(!sensor_mode.delta else { //no temperature correction out_sig[i] = out_sig[i] / get_RAM_gain_factor(ampl_param.working_gain); } #endif //__LT
When the _LT option is defined (the #else part isn't executed) the error appears. The problem is that the warning stays also after commenting/ entering into the define choice the declaration part:
#ifndef __LT const float code ref_int_tmpr = 40 #endif
Any idea why? Thanks, Amitai
If I understood correctly what to check, these are the results:
- in the ampl_driver.i file:
#line 29 "ampl_driver.c" /0 const float code low_photo_signal = 0.0; float xdata tempPar;
searching the file for other relevant 'code' and 'ref_int_tmpr' didn't result in anything.
- in the ampl_driver.lst file:
declaration part:
25 26 #ifndef __LT const float code ref_int_tmpr = 40; #endif 29 30 const float code low_photo_signal = 0.0; 31 32 float xdata tempPar; // fot test perpuose ... ... afterwards: 175 2 #ifdef __LT // 14.10.15 - Amitai 176 2 // photo signal calculation with 177 2 // temperature correction for low temperature camera 178 2 out_sig[i] = (out_sig[i] / get_RAM_gain_factor(ampl_param.working_gain)) - 179 2 low_temperature_correction(case_temperature,t_index,i); 180 2 #else if(!sensor_mode.delta) { //signal with temperature correction out_sig[i] = (out_sig[i] / get_RAM_gain_factor(ampl_param.working_gain)) * ((1 + ref_int_tmpr * ID1_xram.alpha[i]) / (1 + get_temp_sensor() * ID1_xram.alpha[i])); }//if(!sensor_mode.delta else { C51 COMPILER V9.54 AMPL_DRIVER 10/20/2015 12:06:29 PAGE 31 //no temperature correction out_sig[i] = out_sig[i] / get_RAM_gain_factor(ampl_param.working_gain); } #endif //__LT 194 2 }//for(i=0; i<COMMON_NUM; i++) 195 1 return OK_SerialOut; 196 1 }
no 'ref_int_tmpr' in symbols section of file.
So it seems that the compiler ignores the content which is not defined currently, but why is an error appearing? on the other hand changing the definition so that __LT isn't defined results with no errors.
Thanks, Amitai
Is the variable low_photo_signal used somewhere?
The issue is that the compiler/linker cannot distinguish between individual variables. The linker just deals with segments and when there is no reference to a segment the warning 16 is omitted.
If you access one of the variables that warning 16 disappears.
The problem was with the const float code low_photo_signal = 0.0; which is not used in the whole program. Thanks for all the help, Amitai