OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [utils/] [contributions/] [gpio/] [sw/] [old/] [udelay.c] - Blame information for rev 40

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 40 rfajardo
#include "../support/support.h"
2
#include "../support/board.h"
3
 
4
 
5
void udelay(unsigned long);
6
 
7
void udelay(unsigned long usecs)
8
{
9
    unsigned long i;
10
    unsigned long cycles = usecs / (IN_CLK / 1000000 );
11
    unsigned long mem_dummy;
12
    volatile unsigned long* ptr = &mem_dummy;
13
 
14
    for ( i=0; i< cycles; i++)
15
            *ptr = 0xABCD;
16
}
17
 

powered by: WebSVN 2.1.0

© copyright 1999-2021 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.