When I'm trying to use _delay_us(condition ? value_if_true : value_if_false)
in my 1-Wire implementation, delay doesn't work and i get no answer from my device, but it works fine when i replace it with:
if(condition) _delay_us(value_if_true);
else _delay_us(value_if_false);
When i displaying inline if value on lcd it shows the correct value.
So what's the difference between this two notations? How can i make inline if work in _delay_us() ?
The documentation clearly says:
In order for these functions to work as intended, compiler optimizations must be enabled, and the delay time must be an expression that is a known constant at compile-time. If these requirements are not met, the resulting delay will be much longer (and basically unpredictable), and applications that otherwise do not use floating-point calculations will experience severe code bloat by the floating-point library routines linked into the application.