|
|
View previous topic :: View next topic |
Author |
Message |
Thomas Hartmann Guest
|
Code missing in .LST file |
Posted: Mon Jun 02, 2003 10:31 am |
|
|
Hello all,
I am missing code ( functions ) in my list file.
I can not set break points in these functions when debugging with MPLAB 5.70.40 and MPLAB-ICD.
Nonetheless the missing functions are somehow executed because I toggle an output there. I can see the LED blinking ...
Questions 1:
What does the compiler do with that "missing" code ?
Can I trust the compiler on that ?
Why can't I set breakpoints ?
Also I see some "funny" behaviour within these functions:
- I call another function read_eeprom( LENGTH_1 )
@ #define LENGTH_1 8
=> inside the function read_eeprom the parameter reads 2, not 8
- I call set_adc_channel( CHAN_MV )
@ #define CHAN_MV 1
=> ADC 0 is read, not ADC 1, as expected
I replaced the defines with hard coded numbers ( read_eeprom( 8 ) and set_adc_channel( 1 ) ) and all works fine.
Questions 2:
Did anyone experience a similar bahviour ?
Why does the compiler sometimes mess up defines ?
Tnx for your replies
:-)
Thomas
Example code from the .LST file:
---------------------------------------------
0000 07453 .................... if( n1ExecuteMeasurement )
0CE0 1F3C 07454 BTFSS 3C.6
0CE1 2CE5 07455 GOTO 4E5
0000 07456 .................... {
0000 07457 .................... n1ExecuteMeasurement = 0;
0CE2 133C 07458 BCF 3C.6
0000 07459 ....................
0000 07460 .................... measureTemp();
0CE3 2A58 07461 GOTO 258
0000 07462 .................... measureMv();
0CE4 2AB5 07463 GOTO 2B5
0000 07464 ....................
-------------------------------------------------
From my .h-File:
--------------------------------------------
#separate void measureTemp(void);
#separate void measureMv(void); --------------------------------------------
From the tree:
� ��measureTemp 1/93 Ram=13
� � ��read_eeprom_data 0/47 Ram=7
� � ��@DIVS1616 1/81 Ram=6
� ��measureMv 1/118 Ram=9
� ��read_eeprom_data 0/47 Ram=7
� ��read_eeprom_data 0/47 Ram=7
� ��setSelftestADCError 0/22 Ram=1
� ��setSelftestADCError 0/22 Ram=1=============================================
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514962 |
|
|
Tomi Guest
|
Re: Code missing in .LST file |
Posted: Mon Jun 02, 2003 10:45 am |
|
|
Seems that your functions are compiled as INLINE regardless of your #separate directive.
Try to separate the compiler directive from function definition:
#separate
void measureTemp(void);
Instead of "#separate void measureTemp(void);"
:=Hello all,
:=
:=I am missing code ( functions ) in my list file.
:=I can not set break points in these functions when debugging with MPLAB 5.70.40 and MPLAB-ICD.
:=Nonetheless the missing functions are somehow executed because I toggle an output there. I can see the LED blinking ...
:=
:=Questions 1:
:=What does the compiler do with that "missing" code ?
:=Can I trust the compiler on that ?
:=Why can't I set breakpoints ?
:=
:=Also I see some "funny" behaviour within these functions:
:=- I call another function read_eeprom( LENGTH_1 )
:= @ #define LENGTH_1 8
:= => inside the function read_eeprom the parameter reads 2, not 8
:=- I call set_adc_channel( CHAN_MV )
:= @ #define CHAN_MV 1
:= => ADC 0 is read, not ADC 1, as expected
:=
:=I replaced the defines with hard coded numbers ( read_eeprom( 8 ) and set_adc_channel( 1 ) ) and all works fine.
:=
:=Questions 2:
:=Did anyone experience a similar bahviour ?
:=Why does the compiler sometimes mess up defines ?
:=
:=Tnx for your replies
:=
:=:-)
:= Thomas
:=
:=
:=Example code from the .LST file:
:=---------------------------------------------
:=0000 07453 .................... if( n1ExecuteMeasurement )
:=0CE0 1F3C 07454 BTFSS 3C.6
:=0CE1 2CE5 07455 GOTO 4E5
:=0000 07456 .................... {
:=0000 07457 .................... n1ExecuteMeasurement = 0;
:=0CE2 133C 07458 BCF 3C.6
:=0000 07459 ....................
:=0000 07460 .................... measureTemp();
:=0CE3 2A58 07461 GOTO 258
:=0000 07462 .................... measureMv();
:=0CE4 2AB5 07463 GOTO 2B5
:=0000 07464 ....................
:=-------------------------------------------------
:=
:=From my .h-File:
:=--------------------------------------------
:=#separate void measureTemp(void);
:=#separate void measureMv(void); --------------------------------------------
:=
:=From the tree:
:= � ��measureTemp 1/93 Ram=13
:= � � ��read_eeprom_data 0/47 Ram=7
:= � � ��@DIVS1616 1/81 Ram=6
:= � ��measureMv 1/118 Ram=9
:= � ��read_eeprom_data 0/47 Ram=7
:= � ��read_eeprom_data 0/47 Ram=7
:= � ��setSelftestADCError 0/22 Ram=1
:= � ��setSelftestADCError 0/22 Ram=1=============================================
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514963 |
|
|
|
|
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
|