Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

using udelay()?

Altera_Forum
Honored Contributor II
1,889 Views

Hi All, 

Can I direct using udelay()? 

Which time base be used in udelay()? 

Thanks in advance. 

 

Best regards,
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
949 Views

In kernelspace you can use the udelay (microseconds delay) and mdelay (milliseconds delay) functions. 

In userspace ("normal" uClinux C application) you can use the common usleep (microseconds delay) and sleep(seconds delay) function. 

I haven't personally used the sleep bu I have used usleep and udelay and they worked like a charm! 

 

So it depends on what you're writing... When in doubt i'd say go for usleep.  

You have to include unistd.h in order to use usleep.
0 Kudos
Reply