File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -56,19 +56,25 @@ inline void check_valid_digital_pin(uint8_t pin)
5656{
5757 if (__builtin_constant_p (pin)) {
5858 if (pin >= NUM_DIGITAL_PINS) badArg (" pin out of range" );
59- } else {
59+ }
60+ /*
61+ else {
6062 badArg("pin must be a constant");
6163 }
64+ */
6265}
6366
64- /*
6567__attribute ((always_inline))
66- inline void delayMicroseconds(uint16_t us)
68+ static inline void delayMicroseconds(uint16_t us)
6769{
68- _delay_us(us);
70+ us >>= 1 ;
71+ if (us <= 2 ) return ; // function overhead is ~2us
72+ do {
73+ // loop overhead is 4 cycles, so 0.5us @8MHz
74+ _delay_us (1.5 );
75+ } while (--us);
6976}
70- */
71- #define delayMicroseconds (us ) _delay_us(us)
77+ // #define delayMicroseconds(us) _delay_us(us)
7278
7379void delay (uint16_t count);
7480
You can’t perform that action at this time.
0 commit comments