Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "delay.h"
- /* ############################################################# */
- /* ############################################################# */
- /* ############################################################# */
- /*
- ********************************************************************************
- * Designate the delay
- *
- * Description : Wait for 10 milliseconds
- * Arguments : cnt - time to wait
- * Returns : None
- * Note : Internal Function
- ********************************************************************************
- */
- void wait_10ms(int cnt)
- {
- unsigned int i;
- for (i = 0; i < cnt; i++) wait_1ms(10);
- }
- /*
- ********************************************************************************
- * Designate the delay
- *
- * Description : Wait for 1 millisecond
- * Arguments : cnt - time to wait
- * Returns : None
- * Note : Internal Function
- ********************************************************************************
- */
- void wait_1ms(int cnt)
- {
- unsigned int i;
- for (i = 0; i < cnt; i++) wait_1us(660);
- }
- /*
- ********************************************************************************
- * Designate the delay
- *
- * Description : Wait for 1 microsecond
- * Arguments : cnt - time to wait
- * Returns : None
- * Note : Internal Function
- ********************************************************************************
- */
- void wait_1us(int cnt)
- {
- unsigned int i;
- for (i = 0; i < cnt; i++) {
- asm ("NOP"::);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement