diff --git a/avr/common/utils_wait_fixed.asm b/avr/common/utils_wait_fixed.asm index 9be3aba..f94569c 100644 --- a/avr/common/utils_wait_fixed.asm +++ b/avr/common/utils_wait_fixed.asm @@ -53,4 +53,41 @@ Utils_WaitFor100MicroSecs: +; --------------------------------------------------------------------------- +; @routine Utils_WaitFor1MilliSec @global +; +; wait for about 1ms. +; +; @clobbers r22 + +Utils_WaitFor1MilliSec: + push r21 + ldi r21, 10 +Utils_WaitFor1MilliSec_loop: + rcall Utils_WaitFor100MicroSecs ; (R22) + dec r21 + brne Utils_WaitFor1MilliSec_loop + pop r21 + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine Utils_WaitForMilliSecs @global +; +; wait for given amount of milliseconds +; @param r16 number of millisecs to wait +; @clobbers r22 + +Utils_WaitForMilliSecs: + rcall Utils_WaitFor100MicroSecs ; (R22) + dec r16 + brne Utils_WaitForMilliSecs + ret +; @end + + + +