File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ inline void delay(uint32_t msec)
1111 "%~call %x1\n"
1212 : "+r" (ms )
1313 : "i" (delay_impl )
14- : "r19" , " r20" , "r21" // clobbers
14+ : "r20" , "r21" // clobbers
1515 );
1616}
1717
Original file line number Diff line number Diff line change 66#include <avr/io.h>
77#include "macros.inc"
88
9- #define remain r19
10- #define start r20
9+ #define start r0
10+ #define remain r20
1111#define current r21
1212; delay for r26:r24 (u24) ms
1313GLABEL delay_impl
1414 in start , TCNT0
1515 ldi remain , lo8(T0CNT_PER_MS)
16- wait1ms : ; check TCNT0 until 1ms has passed
16+ _wait1ms : ; check TCNT0 until 1ms has passed
1717 in current , TCNT0
1818 sub current , start
1919 add start , current ; advance start
2020 sub remain , current
21- brcc wait1ms
21+ brcc _wait1ms
2222 subi remain , lo8( - (T0CNT_PER_MS)) ; add 1ms
23- decms: ; decrement ms argument
23+ ; decrement ms argument
2424 sbiw r24 , 1
2525 sbci r26 , 0
26- brne wait1ms
26+ brne _wait1ms
2727 ret
2828
You can’t perform that action at this time.
0 commit comments