On Tue, Dec 2, 2014 at 3:36 PM, Michael Hennebry <[email protected]> wrote: > On Tue, 2 Dec 2014, Britton Kerin wrote: > >> 1. Does _delay_us() need a double const, or is an int const guaranteed >> to work? The avr libc manual just says "known const" in one place, >> but the signature calls for a double. > > > _delay_us needs a double const. > It will get a double whether you give it a double or some other number. > That is what prototypes are for. > Prototypes are ordinary C.
Yes, but in many cases the type coercian for that happens at run-time. >> In file included from one_wire_slave.c:8:0: >> /home/bkerin/opt/avr/avr/include/util/delay.h: In function >> ‘ows_write_bit’: >> /home/bkerin/opt/avr/avr/include/util/delay.h:163:28: error: >> __builtin_avr_delay_cycles expects a compile time integer constant >> __builtin_avr_delay_cycles(__ticks_dc); > > > My guess is that a variable or a non-constant > expression was passed to _delay_us. Yes, sorry I wasn't clear: This was what happens when I pass a known non-const. I'm just wondering if this trap is dependable, and if it catches non-double consts, if that's an issue. Britton _______________________________________________ AVR-chat mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/avr-chat
