4 static inline void __attribute__((always_inline)) delay_loop8(uint8_t count)
14 static inline void __attribute__((always_inline)) delay_loop16(uint16_t count)
17 "1: sbiw %0, 1" "\n\t"
24 static inline void __attribute__((always_inline)) delay_us(uint16_t us)
26 uint16_t clocks = F_CPU/1000000*us;
28 delay_loop8(clocks/3);
30 delay_loop16(clocks/4);
33 static inline void __attribute__((always_inline)) delay_ms(uint16_t ms)
35 if(ms<0x40000/(F_CPU/1000))
36 delay_loop16(F_CPU/1000*ms/4);
41 delay_loop16(F_CPU/40000);