Here is the relevant output. I can email you the whole file if you let me know where to send it. There are three copies of this code at different addresses even though there is a single method in the source. I wonder if the default compiler switches in the development environment are forcing this to happen as part of some sort of speed optimisation.
Is this forum the best place to raise this with the developers of the development environment or do they hang out elsewhere?
Julian
void OneWire::reset_search()
{
uint8_t i;
searchJunction = -1;
172: 8f ef ldi r24, 0xFF ; 255
174: 18 96 adiw r26, 0x08 ; 8
176: 8c 93 st X, r24
178: 18 97 sbiw r26, 0x08 ; 8
searchExhausted = 0;
17a: 19 96 adiw r26, 0x09 ; 9
17c: 1c 92 st X, r1
17e: 19 97 sbiw r26, 0x09 ; 9
180: 87 e0 ldi r24, 0x07 ; 7
for( i = 7; ; i--) {
address[i] = 0;
182: fd 01 movw r30, r26
184: e8 0f add r30, r24
186: f1 1d adc r31, r1
188: 10 82 st Z, r1
if ( i == 0) break;
18a: 88 23 and r24, r24
18c: 11 f0 breq .+4 ; 0x192 <_ZN7OneWireC2Eh+0x88>
{
uint8_t i;
searchJunction = -1;
searchExhausted = 0;
for( i = 7; ; i--) {
18e: 81 50 subi r24, 0x01 ; 1
190: f8 cf rjmp .-16 ; 0x182 <_ZN7OneWireC2Eh+0x78>
192: 08 95 ret
void OneWire::reset_search()
{
uint8_t i;
searchJunction = -1;
1fc: 8f ef ldi r24, 0xFF ; 255
1fe: 18 96 adiw r26, 0x08 ; 8
200: 8c 93 st X, r24
202: 18 97 sbiw r26, 0x08 ; 8
searchExhausted = 0;
204: 19 96 adiw r26, 0x09 ; 9
206: 1c 92 st X, r1
208: 19 97 sbiw r26, 0x09 ; 9
20a: 87 e0 ldi r24, 0x07 ; 7
for( i = 7; ; i--) {
address[i] = 0;
20c: fd 01 movw r30, r26
20e: e8 0f add r30, r24
210: f1 1d adc r31, r1
212: 10 82 st Z, r1
if ( i == 0) break;
214: 88 23 and r24, r24
216: 11 f0 breq .+4 ; 0x21c <_ZN7OneWireC1Eh+0x88>
{
uint8_t i;
searchJunction = -1;
searchExhausted = 0;
for( i = 7; ; i--) {
218: 81 50 subi r24, 0x01 ; 1
21a: f8 cf rjmp .-16 ; 0x20c <_ZN7OneWireC1Eh+0x78>
21c: 08 95 ret
0000021e <_ZN7OneWire12reset_searchEv>:
//
// You need to use this function to start a search again from the beginning.
// You do not need to do it for the first search, though you could.
//
void OneWire::reset_search()
21e: dc 01 movw r26, r24
{
uint8_t i;
searchJunction = -1;
220: 8f ef ldi r24, 0xFF ; 255
222: 18 96 adiw r26, 0x08 ; 8
224: 8c 93 st X, r24
226: 18 97 sbiw r26, 0x08 ; 8
searchExhausted = 0;
228: 19 96 adiw r26, 0x09 ; 9
22a: 1c 92 st X, r1
22c: 19 97 sbiw r26, 0x09 ; 9
22e: 87 e0 ldi r24, 0x07 ; 7
for( i = 7; ; i--) {
address[i] = 0;
230: fd 01 movw r30, r26
232: e8 0f add r30, r24
234: f1 1d adc r31, r1
236: 10 82 st Z, r1
if ( i == 0) break;
238: 88 23 and r24, r24
23a: 11 f0 breq .+4 ; 0x240 <_ZN7OneWire12reset_searchEv+0x22>
{
uint8_t i;
searchJunction = -1;
searchExhausted = 0;
for( i = 7; ; i--) {
23c: 81 50 subi r24, 0x01 ; 1
23e: f8 cf rjmp .-16 ; 0x230 <_ZN7OneWire12reset_searchEv+0x12>
240: 08 95 ret
00000242 <_ZN7OneWire4crc8EPhh>:
}