that the problem must be only with get data from the bus in ow_get_bit
function, and finally I found this:
inline unsigned char ow_get_bit(void)
{
unsigned char x=0,global_int_mem=0;
if(inp(SREG)&0x80) { asm("cli"); global_int_mem=1; }
ONE_WIRE_DQ_0();
DELAY_OW_RECOVERY_TIME();
ONE_WIRE_DQ_1();
sbi(PORTB,2); // test
DELAY_OW_READ_POS();
cbi(PORTB,2); //test line 1
//if( BIT_IS_SET(ow_pin_reg, ow_pin )) { x=1; } //original line
if (bit_is_set(PINB,3)) {x=1;} //test line with same result
// cbi(PORTB,2); //test line 2
DELAY_US(ONE_WIRE_READ_SLOT_TIME_US-ONE_WIRE_READ_POSITION_US);
if(global_int_mem) { asm("sei"); }
return(x);
}
The generated .hex file is exactly the same when I use test line 2
instead of test line 1, so it seems, that the heart of the function is
missing from generated code!
I would be very happy if somebody can help me to look into the code,
and help to solve this problem, or can tell me more about possible
differences, what causes this.