#include <hidef.h> /* common defines and macros */ #include <mc9s12dp256.h> /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12dp256b"
char autoset_rssi_rx_rf(){ unsigned char tt[2]; char rssi=-91; float rssi_14_t1; float rssi_14_t2; float rssi_14_t; float rssi_f1_t1; float rssi_f2_t1; float rssi_f_t1; float rssi_f1_t2; float rssi_f2_t2; float rssi_f_t2; float rssi_f_t; tt[0]=2; tt[1]=190;
//eeprom_trx_rd(tt,1024+360, 2);//14875MHz,-45dBm,D,t1=25 rssi_14_t1=256*tt[0]+tt[1]; //702 //eeprom_trx_rd(tt,1024+503, 2);//14875MHz,-45dBm,D,t2=55 rssi_14_t2=256*tt[0]+tt[1]+2; //704 rssi_14_t=rssi_14_t1+(rssi_14_t2-rssi_14_t1)*0.77; // 703 /////////////////////////////////////////////////////////////////////// //eeprom_trx_rd(tt,800+81, 2);//15300MHz,-45dBm,t1=25 rssi_f1_t1=256*tt[0]+tt[1]; //702 //eeprom_trx_rd(tt,800+83, 2);//15350MHz,-45dBm,t1=25 rssi_f2_t1=256*tt[0]+tt[1]+6; //708 rssi_f_t1= (rssi_f2_t1+rssi_f1_t1)/2; //705 ////////////////////////////////////////////////////////////////// //eeprom_trx_rd(tt,800+104, 2);//15300MHz,-45dBm,t2=55 rssi_f1_t2=256*tt[0]+tt[1]; //702 //eeprom_trx_rd(tt,800+106, 2);//15350MHz,-45dBm,t2=55 rssi_f2_t2=256*tt[0]+tt[1]+8; //710 rssi_f_t2=(rssi_f1_t2+rssi_f2_t2)/2; //706 ///////////////////////////////////////////////////////////// rssi_f_t=rssi_f_t1+(rssi_f_t2-rssi_f_t1)*0.77; //705 ////////////////////////////////////////////////////////////// rssi=(char)(rssi_14_t-rssi_f_t); //703-705= -2 return rssi; } void main(void) { /* put your own code here */ char test; test= autoset_rssi_rx_rf(); for(;;) {} /* wait forev
软件仿真时设置断点查看,发现
rssi <not allocated> float rssi_14_t1 <not allocated> float rssi_14_t2 <not allocated> float rssi_14_t <not allocated> float rssi_f1_t1 <not allocated> float rssi_f2_t1 <not allocated> float rssi_f_t1 <not allocated> float rssi_f1_t2 <not allocated> float rssi_f2_t2 <not allocated> float rssi_f_t2 <not allocated> float rssi_f_t <not allocated> float
如果将函数autoset_rssi_rx_rf()的代码全部放到main()中,则一切正常 请问是什么原因,谢谢了。
[此贴子已经被作者于2006-8-25 11:30:47编辑过] |